Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rtp47.UUCP Path: utzoo!linus!decvax!mcnc!rti-sel!rtp47!meissner From: meissner@rtp47.UUCP (Michael Meissner) Newsgroups: net.lang.c Subject: Re: Forward Referencing of Static Variables OK? Message-ID: <206@rtp47.UUCP> Date: Sat, 5-Oct-85 10:48:10 EDT Article-I.D.: rtp47.206 Posted: Sat Oct 5 10:48:10 1985 Date-Received: Wed, 9-Oct-85 04:01:50 EDT References: <1893@brl-tgr.ARPA> Reply-To: meissner@rtp47.UUCP (Michael Meissner) Organization: Data General, RTP, NC Lines: 27 Keywords: ANSI X3J11 In article <1893@brl-tgr.ARPA> gwyn@BRL.ARPA (VLD/VMB) writes: >extern int thing; >... >static int thing = 0; > >is perfectly legitimate according to X3J11. >Why waste time trying to relate this to K&R (not K&P). >Point out to your compiler supplier that they're >going to have to fix this anyway. > Sorry that is wrong. The only thing that ANSI X3J11 allows is: static int thing = 0; foo(){ float thing; /*...*/ { extern int thing; /* refers to static above */ } } Ie, the first declaration MUST be static. Michael Meissner, Data General, ...{ihnp4, decvax}!mcnc!rti-sel!rtp47!meissner