Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site genrad.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!john From: john@genrad.UUCP (John Nelson) Newsgroups: net.lang.c Subject: Re: storage class ambiguity Message-ID: <3610@genrad.UUCP> Date: Wed, 2-Nov-83 09:57:45 EST Article-I.D.: genrad.3610 Posted: Wed Nov 2 09:57:45 1983 Date-Received: Fri, 4-Nov-83 08:10:34 EST References: <223@aecom.UUCP> Organization: GenRad, Bolton, Mass. Lines: 26 There's no ambiguity here, any compiler that acts that way is WRONG!!!! file 1: extern int foo; file 2: extern int foo; This should not generate a loader error, The loader is SUPPOSED to allocate storage for foo. Unfortunately, sometimes C running under operating systems other than UNIX use the existing loader, which does not perform this function. file 1: extern int foo = 8; If the compiler generates an error on this, then it is just plain WRONG! I cannot emphasize this enough. The problem is not that the reference manual should not say that extern is the default storage class, it IS, and any compiler that does not work this way is not strictly C! I had a similar problem with the Whitesmith compiler - all externs had to be initialized (which could be lived with) but also, static's had to be initialized! If you have: file 1: static int foo; you get the compiler message: "undeclared static foo". We don't use Whitesmiths anymore for this and numerous other non-standard items.