// Set the long length modifier for wide characters
if (QT->getPointeeType()->isWideCharType())
LM.setKind(LengthModifier::AsWideChar);
+ else
+ LM.setKind(LengthModifier::None);
return true;
}
// Bad length modifiers
printf("%hhs", "foo");
printf("%1$zp", (void *)0);
-
+
// Perserve the original formatting for unsigned integers.
unsigned long val = 42;
printf("%X", val);
printf("%f", (intmax_t) 42);
printf("%f", (uintmax_t) 42);
printf("%f", (ptrdiff_t) 42);
+
+ // string
+ printf("%ld", "foo");
}
// Validate the fixes...
// CHECK: printf("%jd", (intmax_t) 42);
// CHECK: printf("%ju", (uintmax_t) 42);
// CHECK: printf("%td", (ptrdiff_t) 42);
+// CHECK: printf("%s", "foo");