1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 int printf(const char *, ...);
5 const char* f(const char *s
) __attribute__((format_arg(1)));
7 const char *h(const char *msg1
, const char *msg2
)
8 __attribute__((__format_arg__(1))) __attribute__((__format_arg__(2)));
10 void g(const char *s
) {
12 printf("%d %d", 123); // expected-warning{{more '%' conversions than data arguments}}
15 printf(f("%d %d"), 123); // expected-warning{{more '%' conversions than data arguments}}
18 "", // expected-warning {{format string is empty}}
19 "" // expected-warning {{format string is empty}}
23 "" // expected-warning {{format string is empty}}
26 "", // expected-warning {{format string is empty}}
29 printf(h("%d", "%d"), 123);