| 1 |
/* PR c/50584 - No warning for passing small array to C99 static array |
| 2 |
declarator |
| 3 |
Verify that -Warray-parameter diagnoses mismatches in bounds of |
| 4 |
arrays between redeclarations of the same function and with pointer |
| 5 |
parameters pointing to those arrays. |
| 6 |
{ dg-do compile } |
| 7 |
{ dg-options "-Wall -Warray-parameter" } */ |
| 8 |
|
| 9 |
void fa_x (int (*)[]); // { dg-message "previously declared as 'int \\\(\\\*\\\)\\\[]'" } |
| 10 |
void fa_x (int (*)[2]); // { dg-warning "\\\[-Warray-parameter" } |
| 11 |
void fa_x (int (*)[2]); // { dg-warning "mismatch in bound 1 of argument 1 declared as 'int \\\(\\\*\\\)\\\[2]'" } |
| 12 |
|
| 13 |
void fa_2 (int (*)[2]); // { dg-message "previously declared as 'int \\\(\\\*\\\)\\\[2]'" } |
| 14 |
void fa_2 (int (*)[]); // { dg-warning "mismatch in bound 1 of argument 1 declared as 'int \\\(\\\*\\\)\\\[]'" } |