Path: utzoo!utgpu!watmath!jagardner From: jagardner@watmath.waterloo.edu (Jim Gardner) Newsgroups: comp.lang.c Subject: Re: consistency in declaration Message-ID: <27192@watmath.waterloo.edu> Date: 18 Jun 89 09:41:26 GMT References: <64@BLEKUL11.BITNET> <13732@haddock.ima.isc.com> <14544@watdragon.waterloo.edu> Reply-To: jagardner@watmath.waterloo.edu (Jim Gardner) Organization: U. of Waterloo, Ontario Lines: 34 In article <14544@watdragon.waterloo.edu> jyegiguere@lion.waterloo.edu (Eric Giguere) writes: >In article <13732@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >>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. The phrase you quote does not impose any restrictions. The grammar given in the standard allows mixing. Unless there's some constraint elsewhere in the standard, it seems clear that mixing is allowed. By imposing the restriction, you are demanding that every writer of a portable ANSI conforming program come to the same conclusion as you, and personally impose the same restriction. I say your compiler's broken. (I'm not defending the mixing of parameter declaration identifiers. It seems silly, but macros and automatic code generators can result in silly, but correct, code. <- is that an oxymoron?) > >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 :-) Just to confuse the world, the University of Waterloo C compiler allows you to mix the declarations. (the GCOS8 one, probably the PC and Port ones too) David Tanguay