gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / Wnested-externs-1.c
blob5c4b5ddd8e238234b7755ec54099a29dfed9509d
1 /* Test -Wnested-externs. */
2 /* Origin: Joseph Myers <joseph@codesourcery.com> */
3 /* { dg-do compile } */
4 /* { dg-options "-Wnested-externs" } */
6 int a;
7 static int b;
8 extern int c;
9 void f0(void);
10 static void f1(void);
12 void
13 g(void)
15 extern int a; /* { dg-warning "nested extern declaration of 'a'" } */
16 extern int b; /* { dg-warning "nested extern declaration of 'b'" } */
17 extern int c; /* { dg-warning "nested extern declaration of 'c'" } */
18 extern int d; /* { dg-warning "nested extern declaration of 'd'" } */
19 extern void f0(void); /* { dg-warning "nested extern declaration of 'f0'" } */
20 extern void f1(void); /* { dg-warning "nested extern declaration of 'f1'" } */
21 extern void f2(void); /* { dg-warning "nested extern declaration of 'f2'" } */