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: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Terry Moreland <tmorelan at q dot cis dot uoguelph dot ca>
- 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 10:41:30 +0100 (BST)
- Subject: Re: c/6968: functions that shouldn't accept arguments accept infinitearguments (eg; test() )
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.
--
Joseph S. Myers
jsm28@cam.ac.uk