No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / format / attr-5.c
blob36b1198968744b1f6bc0a00fa5daab78db3f5de9
1 /* Test for format attributes: test default attributes are silently ignored
2 when a function is redeclared in an inappropriate manner. */
3 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "-std=gnu99 -Wformat" } */
7 /* We can't #include "format.h" here. */
9 /* This scanf declaration is static, so can't be the system function. */
10 static int scanf(const char *restrict, ...);
12 /* This sscanf declaration doesn't have variable arguments, so isn't
13 compatible with a format attribute. */
14 extern int sscanf(const char *restrict, const char *restrict, int *); /* { dg-warning "conflict" "conflict" } */
16 void
17 foo (const char *s, int *p)
19 scanf("%ld", p); /* { dg-bogus "format" "static" } */
20 sscanf(s, "%ld", p); /* { dg-bogus "format" "wrong type" } */
23 /* Dummy definition of scanf. */
24 static int
25 scanf (const char *restrict fmt, ...)
27 return 0;