Function type compatibility and the ellipsis

Henry Spencer henry at zoo.toronto.edu
Sun Feb 10 11:35:19 AEST 1991


In article <947 at edg1.UUCP> jsa at edg1.UUCP (J. Stephen Adamczyk) writes:
>Is the following program legal?
>
>int f(int a, ...);
>int f(a) int a; { return 0; }

I would say not; the number of parameters is supposed to match, and the
declaration has one or more parameters while the definition has exactly one.

>Note that of the three cases discussed in the paragraph, only
>this one fails to mention an ellipsis compatibility requirement.

My gut reaction is that the mention of it in the first is redundant, and
in the second it is necessary to separate two different cases of "number
of parameters unknown" (no information vs. varargs).

I'll agree that the wording could have been tighter.
-- 
"Maybe we should tell the truth?"      | Henry Spencer at U of Toronto Zoology
"Surely we aren't that desperate yet." |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.std.c mailing list