]> granicus.if.org Git - clang/commitdiff
Another attempt at fixing format-strings-fixit.c.
authorHans Wennborg <hans@hanshq.net>
Tue, 18 Oct 2011 09:30:37 +0000 (09:30 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 18 Oct 2011 09:30:37 +0000 (09:30 +0000)
Use "%f" as format string to make sure it doesn't match size_t, etc.
whatever they might be typedeffed to, so that the fixit always applies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142348 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/format-strings-fixit.c

index 590b2f32f5318a9f34389c13e95890e79056472d..ca9d934002bd407f87a7954aaa4706cd6c1aebd1 100644 (file)
@@ -54,11 +54,11 @@ void test() {
   typedef __PTRDIFF_TYPE__ ptrdiff_t;
 
   // size_t, etc.
-  printf("%c", (size_t) 42);
-  //printf("%c", (ssize_t) 42);
-  printf("%c", (intmax_t) 42);
-  printf("%c", (uintmax_t) 42);
-  printf("%c", (ptrdiff_t) 42);
+  printf("%f", (size_t) 42);
+  //printf("%f", (ssize_t) 42);
+  printf("%f", (intmax_t) 42);
+  printf("%f", (uintmax_t) 42);
+  printf("%f", (ptrdiff_t) 42);
 }
 
 // Validate the fixes...