[Bug c/63591] No syntax error yielded for semicolons inside a function proto, instead code with memory corruption can be created
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Oct 18 22:56:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63591
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Kjetil Matheussen from comment #0)
> This code should, as far as I know, not be legal C code:
>
> extern int afunction(
> int anint,
> struct Happ *happ; // <- Extra semicolon
> );
>
> int afunction(
> int velocityvelocity,
> struct Happ *happ
> )
> {
> return 208;
> }
>
>
> Gcc does not complain about this code, even with -Wall and -Werror.
GCC 5.0 complains by default.
manuel@gcc10:~$ ~/test1/216257/build/gcc/cc1 test.c
test.c:9:15: warning: ‘struct Happ’ declared inside parameter list
)
^
test.c:9:15: warning: its scope is only this definition or declaration, which
is probably not what you want
(The location is a bit off, yes).
More information about the Gcc-bugs
mailing list