]> granicus.if.org Git - clang/commitdiff
PR4142: Add %m format string specifier.
authorEli Friedman <eli.friedman@gmail.com>
Tue, 2 Jun 2009 08:36:19 +0000 (08:36 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 2 Jun 2009 08:36:19 +0000 (08:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72726 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaChecking.cpp
test/Sema/format-string-percentm.c [new file with mode: 0644]

index c4183a0e61b1edf592fc2631e0fb28f52ff9c807..4856e7fd21649bcf019b66eb86d87cfd078a7655 100644 (file)
@@ -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 (file)
index 0000000..f531372
--- /dev/null
@@ -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");
+}