summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-strings.c
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-05 00:07:51 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-05 00:07:51 +0000
commit81f7f2904cf15fa74f9ab051eb3ca288442a92c7 (patch)
tree4d6d683654be68153dfa641c9215b1e7a39380f3 /clang/test/Sema/format-strings.c
parent5018bd032ac2fdadc11b5b4513755e62b4435ce2 (diff)
downloadbcm5719-llvm-81f7f2904cf15fa74f9ab051eb3ca288442a92c7.tar.gz
bcm5719-llvm-81f7f2904cf15fa74f9ab051eb3ca288442a92c7.zip
Add EXTWARN Diagnostic class.
- Like EXTENSION but always generates a warning (even without -pedantic). - Updated ptr -> int, int -> ptr, and incompatible cast warnings to be EXTWARN. - Other EXTENSION level diagnostics should be audited for upgrade. - Updated several test cases to fix code which produced unanticipated warnings. llvm-svn: 54335
Diffstat (limited to 'clang/test/Sema/format-strings.c')
-rw-r--r--clang/test/Sema/format-strings.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index c1e690a3b80..2d6e719e3ad 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -61,8 +61,8 @@ void check_wide_string(char* b, ...)
va_list ap;
va_start(ap,b);
- printf(L"foo %d",2); // expected-warning {{should not be a wide string}}
- vasprintf(&b,L"bar %d",ap); // expected-warning {{should not be a wide string}}
+ printf(L"foo %d",2); // expected-warning {{incompatible pointer types}}, expected-warning {{should not be a wide string}}
+ vasprintf(&b,L"bar %d",ap); // expected-warning {{incompatible pointer types}}, expected-warning {{should not be a wide string}}
}
void check_asterisk_precision_width(int x) {
@@ -71,4 +71,4 @@ void check_asterisk_precision_width(int x) {
printf("%*d",12,x); // no-warning
printf("%*d","foo",x); // expected-warning {{field width should have type 'int', but argument has type 'char *'}}
printf("%.*d","foo",x); // expected-warning {{field precision should have type 'int', but argument has type 'char *'}}
-} \ No newline at end of file
+}
OpenPOWER on IntegriCloud