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

Tim Smith tim at ism780c.UUCP
Fri Nov 21 12:27:52 AEST 1986


There is already a problem with telling when the declarations end.
Consider this program:

	main() {
		a;      /* declare an integer variable */
		a = 1;  /* put something in it */
	}

Every C compiler I have tried complains about an undeclared variable on
line 2.  If "a" is a global, they have no problem:

	a;
	main() {
		a = 1;
	}
-- 
emordnilapanalpanama

Tim Smith       USENET: sdcrdcf!ism780c!tim   Compuserve: 72257,3706
                Delphi or GEnie: mnementh



More information about the Comp.lang.c mailing list