Daniel Dunbar | 8bf0ccd | 2009-07-25 12:47:38 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
2 | |||||
Anders Carlsson | 8f031b3 | 2009-06-27 04:05:33 +0000 | [diff] [blame] | 3 | #include <stdio.h> |
4 | |||||
5 | const char* f(const char *s) __attribute__((format_arg(1))); | ||||
6 | |||||
7 | void g(const char *s) { | ||||
8 | printf("%d", 123); | ||||
9 | printf("%d %d", 123); // expected-warning{{more '%' conversions than data arguments}} | ||||
10 | |||||
11 | printf(f("%d"), 123); | ||||
12 | printf(f("%d %d"), 123); // expected-warning{{more '%' conversions than data arguments}} | ||||
13 | } |