K&R App A, par. 8 & 8.2, on Declarations, Defaulting.

Hans Albertsson hans at log-hb.UUCP
Mon Jun 25 01:27:56 AEST 1984


[]
In K&R App A, para 8, it is stated
declaration:
	decl-specifiers declarator-list(optional);

and
decl-specifiers:
	type-specifier decl-specifiers(optional);
	sc-specifiers decl-specifiers(optional);


In para 8.2 it is stated: If the type-specifier is missing from a
declaration, it is taken to be int.

I interpret this to mean that a declaration MUST have either a minimum
of one type-specifier, or a minimum of one sc-specifier, and, PROVIDING
this condition is being met, int may be assumed, that is, 
all of

auto a;
int b;
short c;
register int d;
register e;

are acceptable, as opposed to 

a = 1;

since there is NO specifier of any sort in the latter case.

Am I right or wrong? What will ANSI say in this matter?

I know that the Sargasso C for TOPS10/20 requires what I consider correct.
UNIX pcc-based compilers permit the "a = 1;" form. 


-- 
			{decvax,philabs}!mcvax!enea!log-hb!hans
			Hans Albertsson, 
			TeleLOGIC AB
			Box 1001,
			S-14901 Nynashamn,
			SWEDEN



More information about the Comp.lang.c mailing list