Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!exodus!ringworld.Eng.Sun.COM!eager From: eager@ringworld.Eng.Sun.COM (Michael J. Eager) Newsgroups: comp.lang.c Subject: Re: Novice question. Message-ID: <3214@exodus.Eng.Sun.COM> Date: 21 Nov 90 01:40:33 GMT References: <1990Oct31.014132.2400@agate.berkeley.edu> <336@brat.UUCP> <27700@mimsy.umd.edu> <4525@iitmax.IIT.EDU> Sender: news@exodus.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 38 In article <4525@iitmax.IIT.EDU> gkt@iitmax.IIT.EDU (George Thiruvathukal) writes: >It is really appalling what can happen when standards groups get their dirty >paws on something. I was under the impression that Brian Kernighan and Dennis >Ritchie designed the C language. According to the designers of C, an external >reference is one which occurs "exactly once" and "outside any function." The >form presented above for "tentative definition" is an absolutely absurd and >obscure feature for the insinuation of a forward (or external reference). >Congratuations to ANSI on a job well done. > >I would like to make a small point: an example of external references which >are resolved in the same unit of compilation is presented on page 32. Thanks >to the ANSI certified confusion, individuals who program in C who once used the >"extern" as a self-documenting reference to a global variable within a function >will have no facility for such a purpose. Clearly, tentative definition does >not appear to be a well-conceived feature (as explained by Chris Torek) and >would certainly suggest different semantics for external references than the >ones defined on page 31 of K&R. Dennis Ritchie did define the C language, but it was (and is) not a fixed perfect creation. There were several compilers for the C language which implemented features differently. K&R has a number of areas which are open to interpretation. External variable linkage is one of those areas where the description in K&R differed from what the compiler and linker on Unix actually did. Most pre-ANSI compilers and linkers would permit multiple definitions of a variable outside a function, providing that there was only one initializer. Some others didn't. At least with the ANSI standard, there is a clear definition of what is supposed to happen. And you can still write the same code, using the same conventions you were using before. The standard mostly affect the obscure cases which were subject to different interpretation by different compilers. On another point, C has always had (and needed) forward references. This is both in functions and in structure definitions. I fail to see how this is an insinuation of anything into the language. -- Mike Eager