nonnull attribute in installed header vs implementation

Paul Eggert eggert@cs.ucla.edu
Wed Apr 8 17:14:40 GMT 2020


On 4/8/20 9:48 AM, Jeff Law via Libc-alpha wrote:
>> Should we remove the nonnull attribute, drop the check, or somehow make
>> sure that the check cannot be compiled out?
> I'd recommend keeping the attribute -- GCC should be issuing warnings at the call
> site if it detects a NULL pointer for that argument.

Yes, we should keep the attribute, as that helps improve overall reliability.

I suggest dropping the check as the alternative (i.e., making sure the check 
cannot be compiled out) is more trouble than it's worth overall.


More information about the Libc-alpha mailing list