attr-format_arg.c revision 8f031b3b14e726b093fb8693c2be4ab6d779e331
1#include <stdio.h> 2 3const char* f(const char *s) __attribute__((format_arg(1))); 4 5void g(const char *s) { 6 printf("%d", 123); 7 printf("%d %d", 123); // expected-warning{{more '%' conversions than data arguments}} 8 9 printf(f("%d"), 123); 10 printf(f("%d %d"), 123); // expected-warning{{more '%' conversions than data arguments}} 11} 12