[cfe-commits] r133015 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td test/Sema/no-format-y2k-turnsoff-format.c
Fariborz Jahanian
fjahanian at apple.com
Tue Jun 14 14:54:00 PDT 2011
Author: fjahanian
Date: Tue Jun 14 16:54:00 2011
New Revision: 133015
URL: http://llvm.org/viewvc/llvm-project?rev=133015&view=rev
Log:
Bad table discription of fromat-y2k causes
no-format-y2k turn off -Wformat altogether.
// rdar://9504680
Added:
cfe/trunk/test/Sema/no-format-y2k-turnsoff-format.c
Modified:
cfe/trunk/include/clang/Basic/DiagnosticGroups.td
Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=133015&r1=133014&r2=133015&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Tue Jun 14 16:54:00 2011
@@ -217,12 +217,12 @@
// Format settings.
def FormatSecurity : DiagGroup<"format-security">;
+def FormatY2K : DiagGroup<"format-y2k">;
def Format : DiagGroup<"format",
[FormatExtraArgs, FormatZeroLength, NonNull,
- FormatSecurity]>,
+ FormatSecurity, FormatY2K]>,
DiagCategory<"Format String Issue">;
def FormatNonLiteral : DiagGroup<"format-nonliteral", [FormatSecurity]>;
-def FormatY2K : DiagGroup<"format-y2k", [Format]>;
def Format2 : DiagGroup<"format=2",
[FormatNonLiteral, FormatSecurity, FormatY2K]>;
Added: cfe/trunk/test/Sema/no-format-y2k-turnsoff-format.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/no-format-y2k-turnsoff-format.c?rev=133015&view=auto
==============================================================================
--- cfe/trunk/test/Sema/no-format-y2k-turnsoff-format.c (added)
+++ cfe/trunk/test/Sema/no-format-y2k-turnsoff-format.c Tue Jun 14 16:54:00 2011
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -verify -fsyntax-only -Wformat -Wno-format-y2k
+// rdar://9504680
+
+void foo(const char *, ...) __attribute__((__format__ (__printf__, 1, 2)));
+
+void bar(unsigned int a) {
+ foo("%s", a); // expected-warning {{conversion specifies type 'char *' but the argument has type 'unsigned int'}}
+}
+
More information about the cfe-commits
mailing list