Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cbatt!ihnp4!ihdev!pdg From: pdg@ihdev.UUCP (P. D. Guthrie) Newsgroups: comp.lang.c Subject: Re: Why are typedef names in the same name space as variable names? Message-ID: <1063@ihdev.UUCP> Date: Wed, 3-Dec-86 10:00:26 EST Article-I.D.: ihdev.1063 Posted: Wed Dec 3 10:00:26 1986 Date-Received: Wed, 3-Dec-86 22:44:50 EST References: <1092@spice.cs.cmu.edu> <307@cartan.Berkeley.EDU> Reply-To: pdg@ihdev.UUCP (55224-P. D. Guthrie) Distribution: net Organization: American Nasal Amputation Centre Lines: 21 In article <4743@ism780c.UUCP> tim@ism780c.UUCP (Tim Smith) writes: >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 don't see them coming right out and saying it, but it is strongly implied in the text and enforced in the grammar. The exceptions are when you have a storage class identifier (eg register) or when it is an arg to a function (it defaults to int). Something interesting that is in the text though is the way that the default sc-specifiers are assigned. K&R state that the default is auto inside a function and *extern* outside. It seems to be *static* in most C implementations these days. -- Paul Guthrie We come in peace, ihnp4!ihdev!pdg We bring BEER!