Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ucla-cs!sdcrdcf!ism780c!tim From: tim@ism780c.UUCP (Tim Smith) Newsgroups: comp.lang.c Subject: Re: Why are typedef names in the same name space as variable names? Message-ID: <4743@ism780c.UUCP> Date: Mon, 1-Dec-86 20:05:59 EST Article-I.D.: ism780c.4743 Posted: Mon Dec 1 20:05:59 1986 Date-Received: Tue, 2-Dec-86 22:02:45 EST References: <1092@spice.cs.cmu.edu> <307@cartan.Berkeley.EDU> <3644@utcsri.UUCP> <4647@ism780c.UUCP> <3692@utcsri.UUCP> Reply-To: tim@ism780c.UUCP (Tim Smith) Distribution: net Organization: Interactive Systems Corp., Santa Monica, CA Lines: 26 In article <3692@utcsri.UUCP> greg@utcsri.UUCP (Gregory Smith) writes: >>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 */ >> } >> >In the first example, line 2, 'a;' is a statement, to wit, the >expression 'a'. It is an error only because there is no 'a' in scope. >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. ). -- emordnilapregnolanalpanama Tim Smith USENET: sdcrdcf!ism780c!tim Compuserve: 72257,3706 Delphi or GEnie: mnementh