https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121562
Bug ID: 121562
Summary: [-Warray-parameter] False negative with forward
declaration of parameters
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
alx@devuan:~/tmp$ cat fwd.c | nl -ba
1 void f(int a[2]);
2 void f(int a[3]);
3
4 int
5 fwd(int a[2]; int a[3])
6 {
7 return a[0];
8 }
alx@devuan:~/tmp$ gcc -S -Wall -Wextra fwd.c
fwd.c:2:12: warning: argument 1 of type ‘int[3]’ with mismatched bound
[-Warray-parameter=]
2 | void f(int a[3]);
| ~~~~^~~~
fwd.c:1:12: note: previously declared as ‘int[2]’
1 | void f(int a[2]);
| ~~~~^~~~
We should have a similar diagnostic in line 5.