Do not warn about empty format strings when there are no data arguments. Fixes <rdar://problem/9473155>.
llvm-svn: 140777
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index 20c665b..6b5f7e2 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -87,7 +87,12 @@
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, ...)