2 // { dg-options "-Wformat" }
3 // Test that attributes are really applied to function declarations under
5 // Contributed by Jason Merrill (jason@cygnus.com)
7 #define PF __attribute__ ((format (printf, 1, 2)))
10 static PF void f (const char *, ...);
11 static PF void g (const char *, ...) { }
15 void PF h (const char *, ...);
16 void PF k (const char *, ...) { }
20 f ("%f", 42); // { dg-warning "argument 2" }
21 g ("%f", 42); // { dg-warning "argument 2" }
22 h ("%f", 42); // { dg-warning "argument 2" }
23 k ("%f", 42); // { dg-warning "argument 2" }