c/6968: functions that shouldn't accept arguments accept infinite arguments (eg; test() )
Terry Moreland
tmorelan@q.cis.uoguelph.ca
Sat Jun 8 12:37:00 GMT 2002
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
--------------------------------------------------------
More information about the Gcc-bugs
mailing list