diff mbox

[C++] PR 17212

Message ID 4E9771F9.2030803@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 13, 2011, 11:19 p.m. UTC
On 10/13/2011 04:24 PM, Jason Merrill wrote:
> On 10/13/2011 09:53 AM, Paolo Carlini wrote:
>> Yes I briefly wondered that but I know *so* little about that front 
>> end... Do you think we can just add it? Probably yes ;)
> Definitely.  Anything supported in C++ should also be in Obj-C++ by 
> default.
Ok, many thanks to Mike too for the additional clarifications.

I tested on x86_64-linux the below. Ok for mainline?

Thanks,
Paolo.

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

	PR c++/17212
	* c-family/c.opt ([Wformat-zero-length]): Add C++ and Objective-C++.
	* doc/invoke.texi: Update.

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

	PR c++/17212
	* g++.dg/warn/format6.C: New.
	* obj-c++.dg/warn6.mm: Likewise.

Comments

Mike Stump Oct. 14, 2011, 8:07 a.m. UTC | #1
On Oct 13, 2011, at 4:19 PM, Paolo Carlini wrote:
> Ok for mainline?

Ok.
Jason Merrill Oct. 14, 2011, 1:57 p.m. UTC | #2
On 10/13/2011 07:19 PM, Paolo Carlini wrote:
> -@item -Wno-format-zero-length @r{(C and Objective-C only)}
> +@item -Wno-format-zero-length @r{(C, C++, Objective-C and Objective-C++ only)}

I would just remove the {...only} to match the other -Wformat items.

OK.

Jason
Paolo Carlini Oct. 14, 2011, 2:02 p.m. UTC | #3
On 10/14/2011 03:57 PM, Jason Merrill wrote:
> On 10/13/2011 07:19 PM, Paolo Carlini wrote:
>> -@item -Wno-format-zero-length @r{(C and Objective-C only)}
>> +@item -Wno-format-zero-length @r{(C, C++, Objective-C and 
>> Objective-C++ only)}
>
> I would just remove the {...only} to match the other -Wformat items.
Done.

Thanks,
Paolo.
diff mbox

Patch

Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi	(revision 179947)
+++ doc/invoke.texi	(working copy)
@@ -3190,7 +3190,7 @@  in the case of @code{scanf} formats, this option w
 warning if the unused arguments are all pointers, since the Single
 Unix Specification says that such unused arguments are allowed.
 
-@item -Wno-format-zero-length @r{(C and Objective-C only)}
+@item -Wno-format-zero-length @r{(C, C++, Objective-C and Objective-C++ only)}
 @opindex Wno-format-zero-length
 @opindex Wformat-zero-length
 If @option{-Wformat} is specified, do not warn about zero-length formats.
Index: c-family/c.opt
===================================================================
--- c-family/c.opt	(revision 179947)
+++ c-family/c.opt	(working copy)
@@ -396,7 +396,7 @@  C ObjC C++ ObjC++ Var(warn_format_y2k) Warning
 Warn about strftime formats yielding 2-digit years
 
 Wformat-zero-length
-C ObjC Var(warn_format_zero_length) Warning
+C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning
 Warn about zero-length formats
 
 Wformat=
Index: testsuite/g++.dg/warn/format6.C
===================================================================
--- testsuite/g++.dg/warn/format6.C	(revision 0)
+++ testsuite/g++.dg/warn/format6.C	(revision 0)
@@ -0,0 +1,7 @@ 
+// PR c++/17212
+// { dg-options "-Wformat -Wno-format-zero-length" }
+
+void f()
+{
+  __builtin_printf("");
+}
Index: testsuite/obj-c++.dg/warn6.mm
===================================================================
--- testsuite/obj-c++.dg/warn6.mm	(revision 0)
+++ testsuite/obj-c++.dg/warn6.mm	(revision 0)
@@ -0,0 +1,7 @@ 
+// PR c++/17212
+// { dg-options "-Wformat -Wno-format-zero-length" }
+
+void f()
+{
+  __builtin_printf("");
+}