Path: utzoo!utgpu!watmath!watdragon!lion!jyegiguere From: jyegiguere@lion.waterloo.edu (Eric Giguere) Newsgroups: comp.lang.c Subject: Re: consistency in declaration Message-ID: <14544@watdragon.waterloo.edu> Date: 17 Jun 89 03:36:58 GMT References: <64@BLEKUL11.BITNET> <13732@haddock.ima.isc.com> Sender: daemon@watdragon.waterloo.edu Reply-To: jyegiguere@lion.waterloo.edu (Eric Giguere) Organization: U. of Waterloo, Ontario Lines: 28 In article <13732@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >In article <64@BLEKUL11.BITNET> SAAAA04@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@aries5.UWaterloo.ca "Nothing but urges from HELL!!"