public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/6326: non prototype-format parameter type declarators
@ 2002-04-16 8:26 kronos
0 siblings, 0 replies; only message in thread
From: kronos @ 2002-04-16 8:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 6326
>Category: c
>Synopsis: gcc compile illegal code
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Tue Apr 16 08:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 3.0.4
>Organization:
>Environment:
System: Linux dreamland 2.4.18-xfs #2 Mon Mar 4 17:42:57 CET 2002 i586 unknown
Architecture: i586
host: i586-pc-linux-gnu
build: i586-pc-linux-gnu
target: i586-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr --with-slibdir=/lib --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-cpu=k6 --enable-threads : (reconfigured)
>Description:
Quoting from ISO C99:
6.7.5.3 Function declarators (including prototypes)
[...]
14 An identifier list declares only the identifiers of the parameters of
the function. An empty list in a function declarator that is part of
a definition of that function specifies that the function has no
parameters. The empty list in a function declarator that is not part of
a definition of that function specifies that no information about the
number or types of the parameters is supplied.
I think that
int foo() {
return 0;
}
should be equal to
int foo(void) {
return 0;
}
gcc do not complain when I pass one or more paramters to this
function. The code (see below) was compiled with:
gcc -Wall -std=c99 -op p.c
>How-To-Repeat:
int foo() {
return 0;
}
int main(void) {
foo("bar");
foo(1, 2, 3);
foo(3.14);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-04-16 15:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-16 8:26 c/6326: non prototype-format parameter type declarators kronos
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).