File: Wvla-parameter-11.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 (70 lines) | stat: -rw-r--r-- 3,262 bytes parent folder | download | duplicates (2)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* PR c/100719 - missing -Wvla-parameter on a mismatch in second parameter
   { dg-do compile }
   { dg-options "-Wall" } */

typedef struct A1 { int i; } A1;
typedef struct A2 { int i; } A2;
typedef struct A3 { int i; } A3;

extern int n, n1, n2, n3;

void f2 (int, A1[n], A2[n]);
void f2 (int, A1[n], A2[n]);

void f2_x1 (int, A1[n],  A2[n]);        // { dg-note "previously declared as 'A1\\\[n]'" }
void f2_x1 (int, A1[n1], A2[n]);        // { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" }

void f2_x2 (int, A1[n], A2[n]);         // { dg-note "previously declared as 'A2\\\[n]'" }
void f2_x2 (int, A1[n], A2[n2]);        // { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" }


void f3 (int, A1[n], A2[n], A3[n]);
void f3 (int, A1[n], A2[n], A3[n]);

void f3_x1 (int, A1[n],  A2[n], A3[n]);
// { dg-note "previously declared as 'A1\\\[n]'" "note" { target *-*-* } .-1 }
void f3_x1 (int, A1[n1], A2[n], A3[n]);
// { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" "" { target *-*-* } .-1 }

void f3_x2 (int, A1[n], A2[n],  A3[n]);
// { dg-note "previously declared as 'A2\\\[n]'" "note" { target *-*-* } .-1 }
void f3_x2 (int, A1[n], A2[n2], A3[n]);
// { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" "" { target *-*-* } .-1 }

void f3_x3 (int, A1[n], A2[n], A3[n]);
// { dg-note "previously declared as 'A3\\\[n]'" "note" { target *-*-* } .-1 }
void f3_x3 (int, A1[n], A2[n], A3[n3]);
// { dg-warning "argument 4 of type 'A3\\\[n3]' declared with mismatched bound 'n3'" "" { target *-*-* } .-1 }


void g3_x1 (int, A1[n],  A2[*], A3[n]);
// { dg-note "previously declared as 'A1\\\[n]'" "note" { target *-*-* } .-1 }
void g3_x1 (int, A1[n1], A2[*], A3[n]);
// { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" "" { target *-*-* } .-1 }

void g3_x2 (int, A1[*], A2[n],  A3[n]);
// { dg-note "previously declared as 'A2\\\[n]'" "note" { target *-*-* } .-1 }
void g3_x2 (int, A1[*], A2[n2], A3[n]);
// { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" "" { target *-*-* } .-1 }

void g3_x3 (int, A1[*], A2[*], A3[n]);
// { dg-note "previously declared as 'A3\\\[n]'" "note" { target *-*-* } .-1 }
void g3_x3 (int, A1[*], A2[*], A3[n3]);
// { dg-warning "argument 4 of type 'A3\\\[n3]' declared with mismatched bound 'n3'" "" { target *-*-* } .-1 }


void h3_x1 (int, A1[n],  A2[ ], A3[n]);
// { dg-note "previously declared as 'A1\\\[n]'" "note" { target *-*-* } .-1 }
void h3_x1 (int, A1[n1], A2[ ], A3[n]);
// { dg-warning "argument 2 of type 'A1\\\[n1]' declared with mismatched bound 'n1'" "" { target *-*-* } .-1 }

void h3_x2 (int, A1[ ], A2[n],  A3[n]);
// { dg-note "previously declared as 'A2\\\[n]'" "note" { target *-*-* } .-1 }
void h3_x2 (int, A1[ ], A2[n2], A3[n]);
// { dg-warning "argument 3 of type 'A2\\\[n2]' declared with mismatched bound 'n2'" "" { target *-*-* } .-1 }

void h3_x3 (int, A1[ ], A2[ ], A3[n]);
// { dg-note "previously declared as 'A3\\\[n]'" "note" { target *-*-* } .-1 }
void h3_x3 (int, A1[ ], A2[ ], A3[n3]);
// { dg-warning "argument 4 of type 'A3\\\[n3]' declared with mismatched bound 'n3'" "" { target *-*-* } .-1 }