diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-06-17 01:12:20 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-06-17 01:12:20 +0000 |
commit | 98008a47a0b6ec26f4af5e3ad1ff46a7c0d44297 (patch) | |
tree | 98e3bff2cdcf5c35da6e9c76999baed5108c644e /clang/test/Sema/format-strings.c | |
parent | 24c8e4f2457a52b4e9d85424a44f7e9f05adea6e (diff) | |
download | bcm5719-llvm-98008a47a0b6ec26f4af5e3ad1ff46a7c0d44297.tar.gz bcm5719-llvm-98008a47a0b6ec26f4af5e3ad1ff46a7c0d44297.zip |
Fix format string checking of '%c' by treating it as an integer conversion. Fixes PR 7391.
llvm-svn: 106196
Diffstat (limited to 'clang/test/Sema/format-strings.c')
-rw-r--r-- | clang/test/Sema/format-strings.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c index 72aa5927c30..b3c9cc98ef7 100644 --- a/clang/test/Sema/format-strings.c +++ b/clang/test/Sema/format-strings.c @@ -172,6 +172,8 @@ void test10(int x, float f, int i, long long lli) { printf("%f\n", (long double) 1.0); // expected-warning{{conversion specifies type 'double' but the argument has type 'long double'}} // The man page says that a zero precision is okay. printf("%.0Lf", (long double) 1.0); // no-warning + printf("%c\n", "x"); // expected-warning{{conversion specifies type 'int' but the argument has type 'char *'}} + printf("%c\n", 1.23); // expected-warning{{conversion specifies type 'int' but the argument has type 'double'}} } void test11(void *p, char *s) { |