Follow-up Comment #4, bug #57277 (project findutils): > One can't decorate a function with nonnull attribute and then call the function with NULL. Doing that, an optimizing compiler can do aggressive optimizations.
__attribute__ __nonnull__ actually means two things: 1) The compiler may emit warnings when the function is invoked with null arguments. 2) Unless the option -fno-delete-null-pointer-checks is specified, the compiler may make optimizations, assuming that the function will not be invoked with null arguments. Source: https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Common-Function-Attributes.html > either ... or ... Or you pass the option -fno-delete-null-pointer-checks when compiling the code. (I'm not asking you to use this option. Only clarifying that there is a third choice.) _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?57277> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/