C declaration grammar

Henry Spencer henry at zoo.toronto.edu
Wed Aug 8 03:38:30 AEST 1990


In article <1990Aug7.012657.8398 at NCoast.ORG> ramsey at NCoast.ORG (Cedric Ramsey) writes:
>... The production doesn't 
>specify any precedence or order for what should be seen first. For instance, 
>according to this grammar, the following declarations:
>
>const char static i; or 
>static const char i; or
>static char const i;
>
>All would be valid...

They are indeed all valid.  Furthermore, they all mean exactly the same
thing, so there is no question of "precedence" involved.  Many people
would consider only the middle one to be good style, mind you, and ANSI
has hinted that the first one might become illegal eventually (i.e. the
storage class would be required to be first).
-- 
The 486 is to a modern CPU as a Jules  | Henry Spencer at U of Toronto Zoology
Verne reprint is to a modern SF novel. |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list