Article View: comp.std.c
Article #2389Re: Function type compatibility and the ellipsis
From: Henry Spencer
Date: Sun, 10 Feb 1991 00:35
Date: Sun, 10 Feb 1991 00:35
20 lines
1174 bytes
1174 bytes
In article <947@edg1.UUCP> jsa@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@zoo.toronto.edu utzoo!henry
Technical Details
Message-ID:
<1991Feb10.003519.80@zoo.toronto.edu>Path:
arc1-ca.pugleaf.net!utzoo!henryReferences:
<947@edg1.UUCP>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: Function type compatibility and the ellipsis Message-ID: <1991Feb10.003519.80@zoo.toronto.edu> Organization: U of Toronto Zoology References: <947@edg1.UUCP> Date: Sun, 10 Feb 1991 00:35:19 GMT