Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: consistency in declaration Message-ID: <749@sdrc.UUCP> Date: 16 Jun 89 21:42:37 GMT References: <64@BLEKUL11.BITNET> <263@maytag.waterloo.edu> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 31 In article <263@maytag.waterloo.edu>, giguere@aries5.uucp (Eric Giguere) writes: > In article <64@BLEKUL11.BITNET> SAAAA04@BLEKUL11.BITNET writes: > [ is "void foo(int , int y);" a valid declaration? ] > > Seriously, the ANSI specs state that > a function prototype can accept types or types with IDs but not both > in the same declaration. So, yes, you do have to be consistent. > > (I should know, I spent a lot of time debugging all the ANSI stuff we put > into the compiler...) References, please. I checked the draft and I don't see anything that prohibits it. The relevant part of the grammar is: parameter-list: parameter-declaration parameter-list , parameter-declaration parameter-declaration: declaration-specifiers declarator declaration-specifiers abstract-declarator(opt) which pretty clearly allows it, and I don't see any constraints that prohibit it. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@SDRC.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 "You can't get a body like mine in a bottle -- unless you push REAL HARD." - Judy Tenuta / Dr. Pepper