Follow up to How Do I Prototype this?
Colin Plumb
colin at array.UUCP
Fri Jul 6 03:28:46 AEST 1990
In article <351 at demott.COM> kdq at demott.COM (Kevin D. Quitt) writes:
>BTW, my compiler accepts:
>
>int foo( int, ... );
>
> but rejects:
>
>int foo(...);
>
> and calls the ... a syntax error. Anyone: is the above declaration
>ANSI, or K&R, or none of the above?
... is an ANSI invention; no use of it is K&R. However, ANSI requires at
least one argument of a known type before the ... Consider: what type
of argument would you ask for first? You've got no prior arguments to
conditionalise on, so it's got to be a fixed type. So why not declare it?
(Well, you could use a global/static variable, but that's too sick for words.)
--
-Colin
More information about the Comp.lang.c
mailing list