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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
extern void *memmem (const void *__haystack, size_t __haystacklen,
       const void *__needle, size_t __needlelen)
     __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__))
__attribute__ ((__nonnull__ (1, 3)));


memmem is declared with nonnull for the 1st and 3rd argument. If those
arguments are null, the behavior is undefined and the values of those arguments
can be assumed as not null afterwards too.

If you don't want that behavior you can use -fno-delete-null-pointer-checks .

Otherwise the behavior you are seeing is correct behavior based on well defined
code.

Reply via email to