On 2026-07-28 Paul Eggert wrote:
> 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.
These sound very good, thank you!
Or hmm, gnulib-readme.texi has:
C23 was the first C standard to require this behavior
Sorry for a nitpicky question, but is N3322 really retroactively
adopted into C23? See the paragraph "Additionally, WG14 tracks a list"
in [1]. It links to [2] where N3322 is listed as adopted into C2y.
I understand those so that N3322 is a good extension to apply to C23 and
all older standards (so not only C23), but at this point the actual
standards won't be changed to *require* N3322. Only C2y will require it.
[1] https://www.open-std.org/jtc1/sc22/wg14/www/projects.html#DRs
[2] https://www.open-std.org/jtc1/sc22/wg14/www/previous.html
--
Lasse Collin