https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109110
Bug ID: 109110
Summary: Function Declaration Syntax errors at callsite
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: bthomas at brave dot com
Target Milestone: ---
https://godbolt.org/z/Y8rbd35xP
```C
void func1(a)
int a[];
{
}
void func2(int a[])
{
}
int main(void) {
Foo f;
func1(f);
func1(1.0);
func2(f);
func2(1.0);
return 0;
}
```
These two Syntax for declaring a function works fine, however they behave
completely different.
`func2` gives compilation errors:
```
error: incompatible type for argument 1 of 'func2'
expected 'int *' but argument is of type 'Foo'
expected 'int *' but argument is of type 'double'
```
However, `func1` compiles and runs just fine. In fact, if I put a printf to
print the argument, `func1` will also give no warnings even with `-Werror`
unless I explicitly specific `-Wformat`, but `func2` will.
in Clang, all of the above gives both errors and warnings and won't compile.