Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!decwrl!world!geoff From: geoff@world.std.com (Geoff Collyer) Newsgroups: comp.lang.c Subject: Re: Redeclaration of Variables extern/static Keywords: scope, ibm, c news Message-ID: <1991Apr9.055250.24257@world.std.com> Date: 9 Apr 91 05:52:50 GMT References: <^R+_H3-@uzi-9mm.fulcrum.bt.co.uk> <1243@airs.UUCP> Organization: Software Tool & Die Netnews Research Center Lines: 22 Ian G Batten: >>C News, amongst other things, has declarations of ``extern int foo;'' in >>either a header or towards the top of a file, and later has ``static int >>foo;''. ANSI compilers are a low-priority problem for us. We prefer to write code that ANSI and Classic compilers can accept (without ifdefs), but this is an ugly case. Some Classic compilers (including the original one, if memory serves) can't cope with forward static declarations at all. Henry's opinion (I hope I'm not misquoting him) is that there are certain cases that ANSI doesn't cover either (forward static arrays, as I recall). The whole situation is a mess; we may just try to rearrange declarations to avoid forward static declarations altogether. Ian Lance Taylor: >Still, in the long run it would probably be better to change the code (I >have no idea what that would involve). Indeed. But to what? -- Geoff Collyer world.std.com!geoff, uunet.uu.net!geoff