]>
Commit | Line | Data |
---|---|---|
177cce46 MP |
1 | /* { dg-do compile } */ |
2 | /* { dg-options "-std=gnu90 -pedantic-errors -Wc90-c99-compat" } */ | |
3 | ||
4 | _Bool b; /* { dg-error "ISO C90 does not support boolean types" } */ | |
5 | _Complex double c = __builtin_complex (0.0, 0.0); /* { dg-error "ISO C90 does not support complex types" } */ | |
6 | long long l; /* { dg-error "ISO C90 does not support .long long." } */ | |
7 | struct A { int i; char a[]; }; /* { dg-error "ISO C90 does not support flexible array members" } */ | |
8 | struct { long int b: 2; } s; /* { dg-error "type of bit-field .b. is a GCC extension" } */ | |
9 | const const int i; /* { dg-error "duplicate .const." } */ | |
10 | volatile volatile v; /* { dg-error "duplicate .volatile." } */ | |
11 | ||
12 | struct S { int a[2]; }; | |
13 | extern struct S foo (void); | |
14 | ||
15 | #define V(v, ...) (v, __VA_ARGS) /* { dg-error "anonymous variadic macros were introduced in C99" } */ | |
16 | ||
17 | enum { E, }; /* { dg-error "comma at end of enumerator list" } */ | |
18 | ||
19 | void fn1 (char [*]); /* { dg-error "ISO C90 does not support .\\\[\\\*\\\]. array declarators" } */ | |
20 | ||
21 | void | |
22 | fn2 (char x[static 4]) /* { dg-error "ISO C90 does not support .static. or type qualifiers" } */ | |
23 | { | |
24 | int i = (int) { 1 }; /* { dg-error "ISO C90 forbids compound literals" } */ | |
25 | struct A a = { .i = 3 }; /* { dg-error "ISO C90 forbids specifying subobject to initialize" } */ | |
26 | } | |
27 | ||
28 | void | |
29 | fn3 (int n) | |
30 | { | |
31 | n = 3; | |
32 | int i; /* { dg-error "ISO C90 forbids mixed declarations and code" } */ | |
33 | } | |
34 | ||
35 | void | |
36 | fn4 (int n) | |
37 | { | |
38 | n = 3; | |
39 | __extension__ int i; /* { dg-error "ISO C90 forbids mixed declarations and code" } */ | |
40 | } | |
41 | ||
42 | void | |
43 | fn5 (void) | |
44 | { | |
45 | (foo ()).a[0]; /* { dg-error "ISO C90 forbids subscripting non-lvalue array" } */ | |
46 | } | |
47 | ||
48 | #define F(a) a | |
49 | ||
50 | void | |
51 | fn6 (void) | |
52 | { | |
53 | F(); /* { dg-error "invoking macro F argument" } */ | |
54 | } | |
55 | ||
56 | void fn7 (int n, int a[n]); /* { dg-error "ISO C90 forbids variable length array .a." } */ |