* [C++ Patch] PR 50757
@ 2011-10-17 17:48 Paolo Carlini
2011-10-17 18:14 ` Jason Merrill
2011-10-18 8:28 ` Eric Botcazou
0 siblings, 2 replies; 4+ messages in thread
From: Paolo Carlini @ 2011-10-17 17:48 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill
[-- Attachment #1: Type: text/plain, Size: 130 bytes --]
Hi,
exactly like the recently fixed c++/17212. Tested x86_64-linux.
Ok for mainline?
Thanks,
Paolo.
/////////////////////////
[-- Attachment #2: CL_50757 --]
[-- Type: text/plain, Size: 307 bytes --]
/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.
[-- Attachment #3: patch_50757 --]
[-- Type: text/plain, Size: 1745 bytes --]
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);
+}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [C++ Patch] PR 50757
2011-10-17 17:48 [C++ Patch] PR 50757 Paolo Carlini
@ 2011-10-17 18:14 ` Jason Merrill
2011-10-18 8:28 ` Eric Botcazou
1 sibling, 0 replies; 4+ messages in thread
From: Jason Merrill @ 2011-10-17 18:14 UTC (permalink / raw)
To: Paolo Carlini; +Cc: gcc-patches
OK.
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [C++ Patch] PR 50757
2011-10-17 17:48 [C++ Patch] PR 50757 Paolo Carlini
2011-10-17 18:14 ` Jason Merrill
@ 2011-10-18 8:28 ` Eric Botcazou
2011-10-18 10:12 ` Paolo Carlini
1 sibling, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2011-10-18 8:28 UTC (permalink / raw)
To: Paolo Carlini; +Cc: gcc-patches, Jason Merrill
> exactly like the recently fixed c++/17212. Tested x86_64-linux.
c-family has its own ChangeLog file, all changes must be documented there.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [C++ Patch] PR 50757
2011-10-18 8:28 ` Eric Botcazou
@ 2011-10-18 10:12 ` Paolo Carlini
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Carlini @ 2011-10-18 10:12 UTC (permalink / raw)
To: Eric Botcazou; +Cc: gcc-patches, Jason Merrill
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-18 9:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17 17:48 [C++ Patch] PR 50757 Paolo Carlini
2011-10-17 18:14 ` Jason Merrill
2011-10-18 8:28 ` Eric Botcazou
2011-10-18 10:12 ` Paolo Carlini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).