This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/6968: functions that shouldn't accept arguments accept infinitearguments (eg; test() )
- From: Terry Moreland <tmorelan at q dot cis dot uoguelph dot ca>
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Cc: zack at gcc dot gnu dot org, <gcc-bugs at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
- Date: Sat, 8 Jun 2002 15:29:18 -0400 (EDT)
- Subject: Re: c/6968: functions that shouldn't accept arguments accept infinitearguments (eg; test() )
ok, I'll accept that, but still passing arguments to a function defined in this
way should still produce a warning since the arguments are inaccessible from
within the function and it just looks wrong
Terry
On Sat, 8 Jun 2002, Joseph S. Myers wrote:
> On Sat, 8 Jun 2002, Terry Moreland wrote:
>
> > mean that in c99 void test() is a function that takes no arguments since
> > enmpty identifier list is part of the function definition and as such the
> > void test() example should produce an error in c99, but doesn't in gcc 3.1 using
> > -std=c99
> >
> > please let me know if I am wrong, I have slept in a while and the iso c99 spec
> > can be very wordy at times
>
> It specifies, for the purposes of the definition, that it has no
> parameters. It does not, for the purposes of subsequent calls to the
> function, give it a type that includes a prototype, so the subsequent
> calls are not checked.
>
>
--
--------------------------------------------------------
Terry Moreland | Computer and Information Science
tmorelan@uoguelph.ca | University of Guelph
If you were plowing a field, which would you rather use?
Two strong oxen or 1024 chickens?
- Seymour Cray (1925-1996), father of supercomputing
--------------------------------------------------------