diff mbox

[C++] PR 50757

Message ID 4E9C66A4.2070900@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 17, 2011, 5:32 p.m. UTC
Hi,

exactly like the recently fixed c++/17212. Tested x86_64-linux.

Ok for mainline?

Thanks,
Paolo.

/////////////////////////
/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.

Comments

Jason Merrill Oct. 17, 2011, 5:40 p.m. UTC | #1
OK.

Jason
Eric Botcazou Oct. 18, 2011, 7:18 a.m. UTC | #2
> exactly like the recently fixed c++/17212. Tested x86_64-linux.

c-family has its own ChangeLog file, all changes must be documented there.
Paolo Carlini Oct. 18, 2011, 9:21 a.m. UTC | #3
Hi,

>> exactly like the recently fixed c++/17212. Tested x86_64-linux.
> 
> c-family has its own ChangeLog file, all changes must be documented there.

Oh my, I thought I had checked. I'll fix it, sorry.

Paolo
diff mbox

Patch

Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi	(revision 180100)
+++ doc/invoke.texi	(working copy)
@@ -3223,7 +3222,7 @@  Enable @option{-Wformat} plus format checks not in
 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
 
-@item -Wnonnull @r{(C and Objective-C only)}
+@item -Wnonnull
 @opindex Wnonnull
 @opindex Wno-nonnull
 Warn about passing a null pointer for arguments marked as
Index: c-family/c.opt
===================================================================
--- c-family/c.opt	(revision 180100)
+++ c-family/c.opt	(working copy)
@@ -510,7 +510,7 @@  C++ ObjC++ Var(warn_nonvdtor) Warning
 Warn about non-virtual destructors
 
 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
 
 Wnormalized=
Index: testsuite/g++.dg/warn/format7.C
===================================================================
--- testsuite/g++.dg/warn/format7.C	(revision 0)
+++ testsuite/g++.dg/warn/format7.C	(revision 0)
@@ -0,0 +1,10 @@ 
+// PR c++/50757
+// { dg-options "-Wformat -Wno-nonnull" }
+
+extern void *f (void *__s) __attribute__ ((__nonnull__ (1)));
+
+int main()
+{
+  void* const s = 0;
+  f(s);
+}
Index: testsuite/obj-c++.dg/warn7.mm
===================================================================
--- testsuite/obj-c++.dg/warn7.mm	(revision 0)
+++ testsuite/obj-c++.dg/warn7.mm	(revision 0)
@@ -0,0 +1,10 @@ 
+// PR c++/50757
+// { dg-options "-Wformat -Wno-nonnull" }
+
+extern void *f (void *__s) __attribute__ ((__nonnull__ (1)));
+
+int main()
+{
+  void* const s = 0;
+  f(s);
+}