Function type compatibility and the ellipsis

J. Stephen Adamczyk jsa at edg1.UUCP
Sat Feb 9 12:26:51 AEST 1991


Is the following program legal?

int f(int a, ...);
int f(a) int a; { return 0; }

The rules for function type compatibility in 3.5.4.3 say that

"If one type has a parameter type list and the other type is
specified by a function definition that contains a (possibly
empty) identifier list, both shall agree in the number of
parameters, and the type of each prototype parameter shall
be compatible with the type that results from the
application of the default argument promotions to the type
of the corresponding identifier."

Note that of the three cases discussed in the paragraph, only
this one fails to mention an ellipsis compatibility requirement.
An oversight?  An intentional omission?

Steve Adamczyk (jsa at edg.com or uunet!edg1!jsa; 201-744-2620)



More information about the Comp.std.c mailing list