consistency in declaration

Larry Jones scjones at sdrc.UUCP
Sat Jun 17 07:42:37 AEST 1989


In article <263 at maytag.waterloo.edu>, giguere at aries5.uucp (Eric Giguere) writes:
> In article <64 at BLEKUL11.BITNET> SAAAA04 at 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 at 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



More information about the Comp.lang.c mailing list