Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!husc6!harvard!seismo!mcvax!ukc!dcl-cs!david From: david@comp.lancs.ac.uk (David Coffield) Newsgroups: net.lang.c Subject: Proper use of "extern" ... Message-ID: <223@comp.lancs.ac.uk> Date: Thu, 5-Jun-86 13:53:04 EDT Article-I.D.: comp.223 Posted: Thu Jun 5 13:53:04 1986 Date-Received: Sat, 7-Jun-86 13:51:19 EDT Reply-To: david@comp.lancs.ac.uk (David Coffield) Organization: Department of Computing at Lancaster University, UK. Lines: 34 Right. Suggestions, please, as to the correct use of "extern" in the following scenario: A file has two functions in it, "f" and "g", thus static void f() { g(); } static void g() { } f uses g and g is declared after f (I know we can put g before f and the following is no longer applicable but ...). At the top of this file do we put a) static void g() or b) extern void g()? (extern static must be meaningless). My understanding (this varies with the book you read) of "extern" is that it means the object is declared "later in this file or in another file" in which case I vote for (b). Is this right? -- "the secret of success is compost" uucp: ...!mcvax!ukc!dcl-cs!david post: Department of Computing arpa: david%lancs.comp@ucl.cs University of Lancaster, UK janet: david@uk.ac.lancs.comp phone: +44 524 65201 x 4599