Question about Declaration Specifiers

Gary Jackoway gary at hpavla.AVO.HP.COM
Wed Feb 28 02:10:01 AEST 1990


>>I was always under the impression that the rule had to be
>>Declaration_Specifiers : Type_Qualifier Storage_Class_Specifier Type_Specifier

> No, in fact the storage class should be the first word (all other orderings
> are obsolescent).  Nothing is said about the relative ordering of qualifier
> and type specifier, but because of the interaction between qualifiers and `*',
> it can be argued that the logical ordering is SCS TS TQ:
> 	extern int const x;   /* x is a constant int */
> 	extern int const * p; /* p is a pointer to a constant int */
> 	extern int * const p; /* p is a constant pointer to an int */
> This is my preferred ordering.  Opinions will differ.

----------
Too bad you can't do this in MSC.  The "near" specifier has to be
immediately before the function definiton.  This leads to yukky looking
defintions like:
	static int * near foo();
Sigh.

Gary Jackoway



More information about the Comp.lang.c mailing list