This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]