diff options
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r-- | test/Sema/format-strings.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c index 20c665b978..6b5f7e2c26 100644 --- a/test/Sema/format-strings.c +++ b/test/Sema/format-strings.c @@ -87,7 +87,12 @@ void check_empty_format_string(char* buf, ...) va_list ap; va_start(ap,buf); vprintf("",ap); // expected-warning {{format string is empty}} - sprintf(buf,""); // expected-warning {{format string is empty}} + sprintf(buf, "", 1); // expected-warning {{format string is empty}} + + // Don't warn about empty format strings when there are no data arguments. + // This can arise from macro expansions and non-standard format string + // functions. + sprintf(buf, ""); // no-warning } void check_wide_string(char* b, ...) |