Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!iitmax!gkt From: gkt@iitmax.IIT.EDU (George Thiruvathukal) Newsgroups: comp.lang.c Subject: Re: Novice question. Summary: ANSI --> American National Stupidity Institute Message-ID: <4525@iitmax.IIT.EDU> Date: 16 Nov 90 05:45:08 GMT References: <1990Oct31.014132.2400@agate.berkeley.edu> <336@brat.UUCP> <27700@mimsy.umd.edu> Organization: Illinois Institute of Technology, Chicago Lines: 39 In article <27700@mimsy.umd.edu>, chris@mimsy.umd.edu (Chris Torek) writes: > In article <4524@iitmax.IIT.EDU> gkt@iitmax.IIT.EDU (George Thiruvathukal) > writes: > >extern int TempCount; > ... code using TempCount ... > >/* resolution of TempCount in same compilation unit */ > >int TempCount = 5; > > ANSI C has made this form illegal, and requires compilers to handle > this form instead: > > int TempCount; /*T*/ > ... code using TempCount ... > int TempCount = 5; > > The line marked /*T*/ is called a `tenative definition' in X3.159-1989-ese. > -- > In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750) > Domain: chris@cs.umd.edu Path: uunet!mimsy!chris 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. George Thiruvathukal gkt@iitmax.iit.edu