Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c Subject: Re: extern Message-ID: <305@taumet.com> Date: 6 Jul 90 17:20:05 GMT References: <111254@linus.mitre.org> <910@bjcong.bj.co.uk> <277@taumet.com> <16994@haddock.ima.isc.com> <1990Jul5.044045.1534@acc.stolaf.edu> Reply-To: steve@taumet.UUCP (Stephen Clamage) Organization: Taumetric Corporation, San Diego Lines: 18 In article <1990Jul5.044045.1534@acc.stolaf.edu> hannum@haydn.psu.edu (Charles Hannum) writes: >... why didn't ANSI specify that initializers on externs should be >ignored? This would be really keen for the former type of definitions. The problem here is that the keyword "extern" can mean either "external" (defined elsewhere) or "global" (defined here) depending on context. To simplify a bit, for data objects it means external if there is no initializer, global if there is. For functions, the external/global meaning is determined solely by the presence of a function body. I don't think that anyone will argue that this is a wonderful convention, but the ANSI committee inherited it from long C practice. Introducing extern and global keywords as used in other languages (notably assembler) would have had the advantage of precision, but would have broken many (most?) existing programs. -- Steve Clamage, TauMetric Corp, steve@taumet.com