Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c Subject: Re: Scope of externals definitions Message-ID: <8652@utzoo.UUCP> Date: Thu, 24-Sep-87 13:27:56 EDT Article-I.D.: utzoo.8652 Posted: Thu Sep 24 13:27:56 1987 Date-Received: Thu, 24-Sep-87 13:27:56 EDT References: <8959@auspyr.UUCP> Organization: U of Toronto Zoology Lines: 20 Since nobody else has taken this one on... > The scope of an external variable lasts from the point at which it > is declared in a source file to the end of that file. ... Historically, the old C compilers took an "extern" declaration to be global even if it appeared inside a function. X3J11 (1 Oct 1986 draft) says that this is not the case, that the scope of an identifier declared within a function is the function body. (Roughly speaking.) The old behavior is mentioned in the appendix as a "common extension". > The lexical scope of identifiers declared in external definitions > persists from the definition through the end of the source file > in which they appear. This one isn't relevant, because "external definition" in K&Rspeak is a magic phrase with a specific meaning that doesn't apply here. -- "There's a lot more to do in space | Henry Spencer @ U of Toronto Zoology than sending people to Mars." --Bova | {allegra,ihnp4,decvax,utai}!utzoo!henry