Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!mcnc!ncsu!uvacs!edison!steinmetz!davidsen From: davidsen@steinmetz.UUCP (Davidsen) Newsgroups: net.lang.c Subject: Re: Proper use of "extern" ... Message-ID: <787@steinmetz.UUCP> Date: Thu, 12-Jun-86 13:41:14 EDT Article-I.D.: steinmet.787 Posted: Thu Jun 12 13:41:14 1986 Date-Received: Sun, 15-Jun-86 02:22:47 EDT References: <223@comp.lancs.ac.uk> <518@cad.BERKELEY.EDU> Reply-To: davidsen@kbsvax.UUCP (Davidsen) Organization: GE CRD, Schenectady, NY Lines: 48 I just tried the declaration static int foo(); on SysV, BSD, XENIX/286, and a couple of spare C compilers laying around. They all loved it. Even lint accepts it. This has to qualify as current practice, at least. I do know of two compilers which will not let you say extern and then change to static later in the program, so this is not universal practice. X3J11 talked about a program like: static foo(); part1() { extern foo(); foo(20); } part2() { foo(20); } static foo(n) int n; { mumble(n+1); } in terms of which 'foo' is called in part1. Since declarations inside a procedure mask global declarations, if 'foo' inside part1 another foo, which is extern? I left X3J11 after 2 years and I can't find anthing in the latest version of the standard I have (I keep getting the March 85 version from CBEMA) which would clarify the issue. -- -bill davidsen ihnp4!seismo!rochester!steinmetz!--\ \ unirot ------------->---> crdos1!davidsen / sixhub ---------------------/ (davidsen@ge-crd.ARPA) "Stupidity, like virtue, is its own reward"