Commit ef12edb5 by Paolo Carlini Committed by Paolo Carlini

re PR c++/50757 (Cannot turn off -Wnonnull when using C++)

/gcc
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50757
	* c-family/c.opt ([Wnonnull]): Add C++ and Objective-C++.
	* doc/invoke.texi: Update.

/testsuite
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50757
	* g++.dg/warn/format7.C: New.
	* obj-c++.dg/warn7.mm: Likewise.

From-SVN: r180101
parent 42a04c48
...@@ -510,7 +510,7 @@ C++ ObjC++ Var(warn_nonvdtor) Warning ...@@ -510,7 +510,7 @@ C++ ObjC++ Var(warn_nonvdtor) Warning
Warn about non-virtual destructors Warn about non-virtual destructors
Wnonnull Wnonnull
C ObjC Var(warn_nonnull) Warning C ObjC C++ ObjC++ Var(warn_nonnull) Warning
Warn about NULL being passed to argument slots marked as requiring non-NULL Warn about NULL being passed to argument slots marked as requiring non-NULL
Wnormalized= Wnormalized=
......
...@@ -3223,7 +3223,7 @@ Enable @option{-Wformat} plus format checks not included in ...@@ -3223,7 +3223,7 @@ Enable @option{-Wformat} plus format checks not included in
@option{-Wformat}. Currently equivalent to @samp{-Wformat @option{-Wformat}. Currently equivalent to @samp{-Wformat
-Wformat-nonliteral -Wformat-security -Wformat-y2k}. -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
@item -Wnonnull @r{(C and Objective-C only)} @item -Wnonnull
@opindex Wnonnull @opindex Wnonnull
@opindex Wno-nonnull @opindex Wno-nonnull
Warn about passing a null pointer for arguments marked as Warn about passing a null pointer for arguments marked as
......
2011-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50757
* g++.dg/warn/format7.C: New.
* obj-c++.dg/warn7.mm: Likewise.
2011-10-17 Richard Guenther <rguenther@suse.de> 2011-10-17 Richard Guenther <rguenther@suse.de>
PR tree-optimization/50729 PR tree-optimization/50729
......
// PR c++/50757
// { dg-options "-Wformat -Wno-nonnull" }
extern void *f (void *__s) __attribute__ ((__nonnull__ (1)));
int main()
{
void* const s = 0;
f(s);
}
// PR c++/50757
// { dg-options "-Wformat -Wno-nonnull" }
extern void *f (void *__s) __attribute__ ((__nonnull__ (1)));
int main()
{
void* const s = 0;
f(s);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment