This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50757] Cannot turn off -Wnonnull when using C++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50757

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-17
     Ever Confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-17 12:23:34 UTC ---
Confirmed, the diagnostic says it is controlled by -Wnonnull, but that's not a
valid option for G++

extern void *f (void *__s) __attribute__ ((__nonnull__ (1)));

int main()
{
    void* const s = 0;
    f(s);
}

w.cc:6:8: warning: null argument where non-null required (argument 1)
[-Wnonnull]

For G++ that warning is controlled by -Wformat/-Wno-format


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]