Why are typedef names in the same name space as variable names?

Gregory Smith greg at utcsri.UUCP
Thu Dec 4 09:13:48 AEST 1986


In article <4743 at ism780c.UUCP> tim at ism780c.UUCP (Tim Smith) writes:
>>Declarations inside blocks must specify a type or a storage class.  I
>>am not saying that this is perfectly consistent; however it is
>>thoroughly documented.
>
>Where is this documented?  K&R say that the type may be left out of
>declarations ( giving "int" as the default ).  And they mention a
>problem explicitly with typedefs.  I don't see anywhere that says I
>must specify a type in other cases ( on the other hand, I haven't looked
>very hard.  I may have missed it. ).

Well, I take this back. Can't find it in K&R anywhere. It should
be mentioned on page 201 in 9.2, especially. It *has* to be a rule,
since there are umpteem valid declarations that become valid statements
when you don't give a storage class or type:
	int i=1;
	extern foo();
etc.

-- 
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg
Have vAX, will hack...



More information about the Comp.lang.c mailing list