adjectives for typedef'd names

gam at proper.UUCP gam at proper.UUCP
Thu May 10 06:48:46 AEST 1984


Are type adjectives (unsigned, etc) allowed as adjectives
to typedef'd identifiers?  e.g.
	typedef int x;

	func() {
		unsigned x y;
	}

Section 18.2, appendix a of THE BOOK appears to allow it
syntactically.   However, since typedef'd names are also
allowed as structure member names and structure tags, the
structure declaration unsigned x; would appear to be 
ambiguous, or at least non-LR(1)

Section 11.1 of K&R says that typedef'd names can be
identifiers in inner blocks.  If adjectives are allowed
for typedef'd names, the example in 11.1 is more
interesting if "float" is changed to 'int' and 'int'
is changed to 'short':

	typedef int distance;
	main () {
		short distance;
	...
	}

Is `short distance' declaration with no declarator list (as
`short int;'), or a declaration of a `short [int]'
called `distance'?



More information about the Comp.lang.c mailing list