PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / declspec-3-Wextra.c
blob66378cc71d8848ae8758544c6eb3f9c4de02713c
1 /* See declspec-3.c . Test -Wold-style-declaration is enabled by -Wextra. */
2 /* { dg-do compile } */
3 /* { dg-options "-Wextra" } */
5 static int x0;
6 int static x1; /* { dg-warning "not at beginning" } */
8 extern int x2;
9 int extern x3; /* { dg-warning "not at beginning" } */
11 typedef int x4;
12 int typedef x5; /* { dg-warning "not at beginning" } */
14 void g (int);
16 void
17 f (void)
19 auto int x6 = 0;
20 int auto x7 = 0; /* { dg-warning "not at beginning" } */
21 register int x8 = 0;
22 int register x9 = 0; /* { dg-warning "not at beginning" } */
23 g (x6 + x7 + x8 + x9);
26 const static int x10; /* { dg-warning "not at beginning" } */
28 /* Attributes are OK before storage class specifiers, since some
29 attributes are like such specifiers themselves. */
31 __attribute__((format(printf, 1, 2))) static void h (const char *, ...);
32 __attribute__((format(printf, 1, 2))) void static i (const char *, ...); /* { dg-warning "not at beginning" } */