On my first attempt, which I didn't save, I asked a bit tersely. My tone may have looked like a pragmatic C programmer wanting to get their homework or dayjob done, so I got a reply that was the one a fellow student or coworker would give, which was “oh, you're right, but the list of functions that you can call with NULL and a size of 0 as an exception is: memcpy, memset, …”

But when I tried to reproduce in order to make this thread, I phrased the question more precisely, so I got this instead.

This is, of course, even worse.

It rephrases the question, like a human would do to eliminate ambiguity and show they understand the question. And it provides some bits of truth, namely that memcpy, memmove and memcmp shouldn't be called with a NULL pointer even with a size of 0. Another truth is that memccpy and memset_explicit were added in C23 (if it seems to you it was older than that, you're thinking of memset_s, but that story is for a different thread). And then, when your guard is down, it tells you about the part it made up entirely, which is that there are guarantees that apply to these functions. Absolutely not, there are none, check for yourself:

cigix.me/c23#7.26.2.2
cigix.me/c23#7.26.6.2

All the hints of a thoughtful answer written by a knowledgeable human. And then made-up bullshit. And then some classic truths again to complete the bullshit sandwich.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://tech.lgbt/users/void_friend/statuses/114875371585085737 on your instance and quote it. (Note that quoting is not supported in Mastodon.)