This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37940] New: no error detected for semicolon in C function declaration
- From: "janis at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Oct 2008 18:34:59 -0000
- Subject: [Bug c/37940] New: no error detected for semicolon in C function declaration
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code has an extra semi-colon at the end of the function prototype
declaring bad_func1:
void bad_func1 (unsigned long long arg1, const char *arg2 ; );
void bad_func2 ()
{
const char *foo = "foo";
bad_func1 (0, foo);
}
GCC 3.4 reports an error:
elm3b187% /home/janis/tools/gcc-3.4-anonsvn/bin/gcc -c bug.c
bug.c:1: error: parameter "arg1" has just a forward declaration
bug.c:1: error: parameter "arg2" has just a forward declaration
GCC 4.0 and later (including current mainline) accept the code with no error or
warning, even with -Wall, and generate code as if the prototype did not exist
rather than generating code as if the semicolon did not exist.
--
Summary: no error detected for semicolon in C function
declaration
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: janis at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37940