diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-02-16 16:34:54 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-02-16 16:34:54 +0000 |
commit | 32addd519c6699000ff79c387a1c87f0ab7c3698 (patch) | |
tree | 310f61f2bf177db587fe8452e88c2c12d2740b5d /test/Sema/format-strings.c | |
parent | d1ac03ebac3ab5a8456b955e3f8634f786843f9a (diff) |
Format string analysis: give 'q' its own enumerator.
This is in preparation for being able to warn about 'q' and other
non-standard format string features.
It also allows us to print its name correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r-- | test/Sema/format-strings.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c index a7b40f8a55..e6ce6e3c4a 100644 --- a/test/Sema/format-strings.c +++ b/test/Sema/format-strings.c @@ -167,7 +167,9 @@ void test10(int x, float f, int i, long long lli) { printf("%.d", x); // no-warning printf("%.", x); // expected-warning{{incomplete format specifier}} printf("%f", 4); // expected-warning{{format specifies type 'double' but the argument has type 'int'}} - printf("%qd", lli); + printf("%qd", lli); // no-warning + printf("%qd", x); // expected-warning{{format specifies type 'long long' but the argument has type 'int'}} + printf("%qp", (void *)0); // expected-warning{{length modifier 'q' results in undefined behavior or no effect with 'p' conversion specifier}} printf("hhX %hhX", (unsigned char)10); // no-warning printf("llX %llX", (long long) 10); // no-warning // This is fine, because there is an implicit conversion to an int. |