2011-10-14 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-14 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/17212
* g++.dg/warn/format6.C: New.
* obj-c++.dg/warn6.mm: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179963
138bc75d-0d04-0410-961f-
82ee72b054a4
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=
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.
--- /dev/null
+// PR c++/17212
+// { dg-options "-Wformat -Wno-format-zero-length" }
+
+void f()
+{
+ __builtin_printf("");
+}
--- /dev/null
+// PR c++/17212
+// { dg-options "-Wformat -Wno-format-zero-length" }
+
+void f()
+{
+ __builtin_printf("");
+}