https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121846

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Robert Seacord from comment #3)
> > Dup.
> > 
> > *** This bug has been marked as a duplicate of bug 112783 ***
> 
> I don't think this is a duplicate because I'm reporting this as a bug
> against the compiler optimizer and not the library.

yes I know but it was already fixed in GCC 15. See PR 117023 which implemented
nonnull_if_nonzero  BUT (older) glibc still marks memcpy as nonnull so you
still get the old behavior in many cases.


> 
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf which was adopted
> into C2Y eliminates this undefined behavior so that calling memcpy, memmove,
> memset, memcmp and various other functions with a null pointer argument and
> length 0 is well-defined.  We also put this on the list of papers
> https://www.open-std.org/jtc1/sc22/wg14/www/previous.html that should be
> applied to "obsolete versions of C".(In reply to Andrew Pinski from comment
> #2)

Reply via email to