On 2026-07-28 11:35, Lasse Collin wrote:
Instead of workarounds, maybe the NULL-as-a-function-argument part of
N3322 could just be documented as "not fixed by Gnulib".
doc/gnulib-readme.texi refers to N3322 about NULL + 0, so an extra note
there would be good to ensure that readers won't accidentally think
that everything from N3322 is assumed.
This (unfortunately) sounds like a better approach than trying to have Gnulib 
support that part of N3322, which I don't see how we could easily do.

So how about if we add a sentence like this to the N3322 part of 
gnulib-readme.texi:

-----
However, Gnulib does not assume all of N3322;
for example, many circa-2026 compilers that advertise C23 conformance
generate code based on the incorrect assumption that a pointer
cannot be null when passed to a function like @code{memcpy} even
if the corresponding size is zero, so Gnulib code refrains from
using these functions in this way.
-----

And then add a sentence like "This function cannot be given a null pointer argument even when 
given a zero size." to the "Portability problems not fixed by Gnulib" in 
doc/posix-functions/memcpy.texi etc.

Reply via email to