https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125643
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
For comparison, clang says (with -Weverything):
<source>:1:7: warning: a function declaration without a prototype is deprecated
in all versions of C [-Wstrict-prototypes]
1 | void f() int; {
| ^
| void
<source>:1:9: error: expected ';' after top level declarator
1 | void f() int; {
| ^
| ;
<source>:1:10: warning: declaration does not declare anything
[-Wmissing-declarations]
1 | void f() int; {
| ^~~
<source>:1:15: error: expected identifier or '('
1 | void f() int; {
| ^
2 warnings and 2 errors generated.
Compiler returned: 1
GCC can also be made to add an additional warning with -Wmissing-prototypes,
but that's it:
<source>:1:6: warning: no previous prototype for 'f' [-Wmissing-prototypes]
1 | void f() int; {
| ^
<source>: In function 'f':
<source>:1:10: warning: empty declaration
1 | void f() int; {
| ^~~
Compiler returned: 0