File: Wc90-c99-compat-3.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (56 lines) | stat: -rw-r--r-- 1,816 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* { dg-do compile } */
/* { dg-options "-std=gnu11 -Wc90-c99-compat -pedantic-errors" } */

_Bool b; /* { dg-warning "ISO C90 does not support boolean types" } */
_Complex double c = __builtin_complex (0.0, 0.0); /* { dg-warning "ISO C90 does not support complex types" } */
long long l; /* { dg-warning "ISO C90 does not support .long long." } */
struct A { int i; char a[]; }; /* { dg-warning "ISO C90 does not support flexible array members" } */
struct { long int b: 2; } s; /* { dg-warning "type of bit-field .b. is a GCC extension" } */
const const int i; /* { dg-warning "duplicate .const." } */
volatile volatile int v; /* { dg-warning "duplicate .volatile." } */

struct S { int a[2]; };
extern struct S foo (void);

#define V(v, ...) (v, __VA_ARGS) /* { dg-warning "anonymous variadic macros were introduced in C99" } */

enum { E, }; /* { dg-warning "comma at end of enumerator list" } */

void fn1 (char [*]); /* { dg-warning "ISO C90 does not support .\\\[\\\*\\\]. array declarators" } */

void
fn2 (char x[static 4]) /* { dg-warning "ISO C90 does not support .static. or type qualifiers" } */
{
  int i = (int) { 1 }; /* { dg-warning "ISO C90 forbids compound literals" } */
  struct A a = { .i = 3 }; /* { dg-warning "ISO C90 forbids specifying subobject to initialize" } */
}

void
fn3 (int n)
{
  n = 3;
  int i; /* { dg-warning "ISO C90 forbids mixed declarations and code" } */
}

void
fn4 (int n)
{
  n = 3;
  __extension__ int i; /* { dg-warning "ISO C90 forbids mixed declarations and code" } */
}

void
fn5 (void)
{
  (foo ()).a[0]; /* { dg-warning "ISO C90 forbids subscripting non-lvalue array" } */
}

#define F(a) a

void
fn6 (void)
{
  F(); /* { dg-warning "invoking macro F argument" } */
}

void fn7 (int n, int a[n]); /* { dg-warning "ISO C90 forbids variable length array .a." } */