Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / Wc90-c99-compat-1.c
blob15e71e8f8da0b1626d5a41e6d10c036ab4b5eef7
1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu90 -Wpedantic -Wc90-c99-compat" } */
4 _Bool b; /* { dg-warning "ISO C90 does not support boolean types" } */
5 _Complex double c = __builtin_complex (0.0, 0.0); /* { dg-warning "ISO C90 does not support complex types" } */
6 long long l; /* { dg-warning "ISO C90 does not support .long long." } */
7 struct A { int i; char a[]; }; /* { dg-warning "ISO C90 does not support flexible array members" } */
8 struct { long int b: 2; } s; /* { dg-warning "type of bit-field .b. is a GCC extension" } */
9 const const int i; /* { dg-warning "duplicate .const." } */
10 volatile volatile v; /* { dg-warning "duplicate .volatile." } */
12 struct S { int a[2]; };
13 extern struct S foo (void);
15 #define V(v, ...) (v, __VA_ARGS) /* { dg-warning "anonymous variadic macros were introduced in C99" } */
17 enum { E, }; /* { dg-warning "comma at end of enumerator list" } */
19 void fn1 (char [*]); /* { dg-warning "ISO C90 does not support .\\\[\\\*\\\]. array declarators" } */
21 void
22 fn2 (char x[static 4]) /* { dg-warning "ISO C90 does not support .static. or type qualifiers" } */
24 int i = (int) { 1 }; /* { dg-warning "ISO C90 forbids compound literals" } */
25 struct A a = { .i = 3 }; /* { dg-warning "ISO C90 forbids specifying subobject to initialize" } */
28 void
29 fn3 (int n)
31 n = 3;
32 int i; /* { dg-warning "ISO C90 forbids mixed declarations and code" } */
35 void
36 fn4 (int n)
38 n = 3;
39 __extension__ int i; /* { dg-warning "ISO C90 forbids mixed declarations and code" } */
42 void
43 fn5 (void)
45 (foo ()).a[0]; /* { dg-warning "ISO C90 forbids subscripting non-lvalue array" } */
48 #define F(a) a
50 void
51 fn6 (void)
53 F(); /* { dg-warning "invoking macro F argument" } */
56 void fn7 (int n, int a[n]); /* { dg-warning "ISO C90 forbids variable length array .a." } */