------- Comment #7 from pgut001 at cs dot auckland dot ac dot nz 2008-06-10 09:27 ------- >The developer of the API says that it must be non-NULL so when the developer >of the API then tests for NULLness he is either being stupid or really just >thinking that the user will not use it correctly but since the warning is >there
But the warning *isnt't* there, gcc doesn't reliably warn about incorrect use of a NULL pointer. If gcc could reliably detect use of a NULL pointer and warn about it, and *then* remove the NULL pointer checks that'd be fine. At the moment gcc doesn't warn about NULL pointer use but does remove code that would catch inadvertent NULL pointer use, and that's my complaint with the way the attribute works - it's what James Reason (who specialises in safety engineering) would call a latent pathogen. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36166