URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
689 |
jeremybenn |
/* Test warnings for shadowing in function prototype scope: generally
|
| 2 |
|
|
useless but of use if the parameter is used within the scope. Bug
|
| 3 |
|
|
529. */
|
| 4 |
|
|
/* Origin: Joseph Myers <joseph@codesourcery.com> */
|
| 5 |
|
|
/* { dg-do compile } */
|
| 6 |
|
|
/* { dg-options "-std=gnu89 -Wshadow" } */
|
| 7 |
|
|
|
| 8 |
|
|
int v; /* { dg-warning "shadowed declaration" } */
|
| 9 |
|
|
int f1(int v);
|
| 10 |
|
|
int f2(int v, int x[v]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */
|
| 11 |
|
|
int f3(int v, int y[sizeof(v)]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */
|
| 12 |
|
|
int f4(int v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
|
| 13 |
|
|
int f5(int v, int x[v]) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
|
| 14 |
|
|
int f6(int x) { return 0; }
|
| 15 |
|
|
int f7(v) int v; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
|
| 16 |
|
|
int f8(v, w) int v; int w[v]; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
|
| 17 |
|
|
int f9(x) int x; { return 0; }
|
| 18 |
|
|
int f10(v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
|
| 19 |
|
|
int f11(int a, int b(int a));
|
| 20 |
|
|
int f12(int a, int b(int a, int x[a])); /* { dg-warning "declaration of 'a' shadows a parameter" } */
|
| 21 |
|
|
/* { dg-warning "shadowed declaration" "outer parm" { target *-*-* } 20 } */
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.