consistency in declaration
Eric Giguere
jyegiguere at lion.waterloo.edu
Sat Jun 17 13:36:58 AEST 1989
In article <13732 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
>In article <64 at BLEKUL11.BITNET> SAAAA04 at BLEKUL11.BITNET writes:
>>[compiler refuses to accept a prototype with half-named args:]
>> void foo(int , int y);
>>Do I have to be consistent ? Or is this a bug in the compiler ?
>
>The pANS grammar allows this notation, and I can't find any constraint against
>it. I'd say it's a compiler bug.
Compiler bug? The specific phrasing in the pANS is
"A parameter type list specifies the types of, and may declare
identifiers for, the parameters of the function." (3.5.4.3)
As Karl says, this does not in fact disallow the case above. Nor does it
allow it... it's ambiguous. Personally I prefer the approach that a
prototype either declares identifiers for all the parameters or leaves them
all out. I really can't see any reason for the inconsistent notation.
In any case that's the way we've implemented it in Waterloo C. Apparently
that's the way Microsoft does it as well... Watcom C probably does it that
way too.... but I suppose we're quibbling over very minor details. Let's
get back to trigraphs :-)
Eric Giguere 268 Phillip St #CL-46
For the curious: it's French ("jee-gair") Waterloo, Ontario N2L 6G9
Bitnet : GIGUERE at WATCSG (519) 746-6565
Internet: giguere at aries5.UWaterloo.ca "Nothing but urges from HELL!!"
More information about the Comp.lang.c
mailing list