summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-06-02 08:36:19 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-06-02 08:36:19 +0000
commitb92abb460be254fe577ccb95355ff7debf6a7719 (patch)
tree95b6a9fdbc345408ac5c5edc012b3c36a9673690
parent4da925578a43636cf8ad87f8fa82a8fe9b566c92 (diff)
downloadclang-b92abb460be254fe577ccb95355ff7debf6a7719.tar.gz
PR4142: Add %m format string specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72726 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaChecking.cpp5
-rw-r--r--test/Sema/format-string-percentm.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index c4183a0e61..4856e7fd21 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -1062,6 +1062,11 @@ void Sema::CheckPrintfString(const StringLiteral *FExpr,
CurrentState = state_OrdChr;
break;
+ case 'm':
+ // FIXME: Warn in situations where this isn't supported!
+ CurrentState = state_OrdChr;
+ break;
+
// CHECK: Are we using "%n"? Issue a warning.
case 'n': {
++numConversions;
diff --git a/test/Sema/format-string-percentm.c b/test/Sema/format-string-percentm.c
new file mode 100644
index 0000000000..f531372fd4
--- /dev/null
+++ b/test/Sema/format-string-percentm.c
@@ -0,0 +1,6 @@
+// RUN: clang-cc -fsyntax-only -verify %s -triple i686-pc-linux-gnu
+
+int printf(char const*,...);
+void percentm(void) {
+ printf("%m");
+}