This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63591] New: No syntax error yielded for semicolons inside a function proto, instead code with memory corruption can be created
- From: "k.s.matheussen at notam02 dot no" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 18 Oct 2014 21:44:00 +0000
- Subject: [Bug c/63591] New: No syntax error yielded for semicolons inside a function proto, instead code with memory corruption can be created
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63591
Bug ID: 63591
Summary: No syntax error yielded for semicolons inside a
function proto, instead code with memory corruption
can be created
Product: gcc
Version: 4.8.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: k.s.matheussen at notam02 dot no
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.
I'm also seeing memory corruption in a larger program I'm working on,
because of this extra misplaced semicolon, but I haven't been able
to create a smaller example doing this. Please let me know if you need
the larger example causing memory corruption.
I consider this bug (I assume it is a bug) quite serious.
If adding this extra semicolon by mistake (like I did), things appear
to work as normal, whille possibly getting serious bugs which are
hard to trace.