aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-06-17 01:12:20 +0000
committerTed Kremenek <kremenek@apple.com>2010-06-17 01:12:20 +0000
commit01cb1aa458516b9061a65ea4b8a2ca55f71cb34f (patch)
tree26a12ddc9f1d2eb8c04d7bb5a90ed9f18085f8a1 /test/Sema/format-strings.c
parent252485e6bf88064e8cce5b47da2481e6c795c21d (diff)
Fix format string checking of '%c' by treating it as an integer conversion. Fixes PR 7391.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index 72aa5927c3..b3c9cc98ef 100644
--- a/test/Sema/format-strings.c
+++ b/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) {