aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-06-14 21:54:00 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-06-14 21:54:00 +0000
commit997e15cfdc5c78cf3cd9c520dd1bcf3eef4750c0 (patch)
tree247f74ef9fd6cb90d5d742a80a688d2099996905
parentc31e0169b8821e6dd2b2125c5d3a13609ed7aef1 (diff)
Bad table discription of fromat-y2k causes
no-format-y2k turn off -Wformat altogether. // rdar://9504680 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133015 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticGroups.td4
-rw-r--r--test/Sema/no-format-y2k-turnsoff-format.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td
index 9abd6d3c57..9d2bf03862 100644
--- a/include/clang/Basic/DiagnosticGroups.td
+++ b/include/clang/Basic/DiagnosticGroups.td
@@ -217,12 +217,12 @@ def Unused : DiagGroup<"unused",
// 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]>;
diff --git a/test/Sema/no-format-y2k-turnsoff-format.c b/test/Sema/no-format-y2k-turnsoff-format.c
new file mode 100644
index 0000000000..bd06e506ce
--- /dev/null
+++ b/test/Sema/no-format-y2k-turnsoff-format.c
@@ -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'}}
+}
+