]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/Wc90-c99-compat-3.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Wc90-c99-compat-3.c
CommitLineData
f3bede71
MP
1/* { dg-do compile } */
2/* { dg-options "-std=gnu11 -Wc90-c99-compat -pedantic-errors" } */
3
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" } */
6long long l; /* { dg-warning "ISO C90 does not support .long long." } */
7struct A { int i; char a[]; }; /* { dg-warning "ISO C90 does not support flexible array members" } */
8struct { long int b: 2; } s; /* { dg-warning "type of bit-field .b. is a GCC extension" } */
9const const int i; /* { dg-warning "duplicate .const." } */
10volatile volatile int v; /* { dg-warning "duplicate .volatile." } */
11
12struct S { int a[2]; };
13extern struct S foo (void);
14
15#define V(v, ...) (v, __VA_ARGS) /* { dg-warning "anonymous variadic macros were introduced in C99" } */
16
17enum { E, }; /* { dg-warning "comma at end of enumerator list" } */
18
19void fn1 (char [*]); /* { dg-warning "ISO C90 does not support .\\\[\\\*\\\]. array declarators" } */
20
21void
22fn2 (char x[static 4]) /* { dg-warning "ISO C90 does not support .static. or type qualifiers" } */
23{
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" } */
26}
27
28void
29fn3 (int n)
30{
31 n = 3;
32 int i; /* { dg-warning "ISO C90 forbids mixed declarations and code" } */
33}
34
35void
36fn4 (int n)
37{
38 n = 3;
39 __extension__ int i; /* { dg-warning "ISO C90 forbids mixed declarations and code" } */
40}
41
42void
43fn5 (void)
44{
45 (foo ()).a[0]; /* { dg-warning "ISO C90 forbids subscripting non-lvalue array" } */
46}
47
48#define F(a) a
49
50void
51fn6 (void)
52{
53 F(); /* { dg-warning "invoking macro F argument" } */
54}
55
56void fn7 (int n, int a[n]); /* { dg-warning "ISO C90 forbids variable length array .a." } */