public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37940] New: no error detected for semicolon in C function declaration
@ 2008-10-28 18:36 janis at gcc dot gnu dot org
2008-10-28 20:27 ` [Bug c/37940] " jsm28 at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: janis at gcc dot gnu dot org @ 2008-10-28 18:36 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-28 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-28 18:36 [Bug c/37940] New: no error detected for semicolon in C function declaration janis at gcc dot gnu dot org
2008-10-28 20:27 ` [Bug c/37940] " jsm28 at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).