This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36166] Use of the 'nonnull' attribute breaks code
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2008 09:19:39 -0000
- Subject: [Bug middle-end/36166] Use of the 'nonnull' attribute breaks code
- References: <bug-36166-15916@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-06-10 09:19 -------
>gcc doesn't just use it for that, it applies two often mutually exclusive interpretations to the same
> attribute.
They are no mutually exclusive at all. Think of it is this way. 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, there is no
reason for the function itself to test for NULLness which is why GCC optimizes
away the check.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36166