Redeclaration of Variables extern/static

Henry Spencer henry at zoo.toronto.edu
Wed Apr 10 03:25:36 AEST 1991


In article <1991Apr9.055250.24257 at world.std.com> geoff at world.std.com (Geoff Collyer) writes:
>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).

Forward static arrays of unspecified size are the problem.  For those, there
simply is no portable way to write a forward declaration, and we're simply
going to have to avoid doing this.

For everything else, the problem is not unsolvable, merely awkward.  Old
compilers won't take static forward declarations at all, while new ones 
won't take extern forward declarations for static objects.  The choice is
between avoiding forward declarations entirely, using a macro so you can
make them extern or static as required, or just giving up and making the
objects extern.  These are all somewhat distasteful.

While we do intend to be ANSI compatible, our development systems have
historically used old compilers, and it will be quite a while before the
last lingering glitches get sorted out.
-- 
"The stories one hears about putting up | Henry Spencer @ U of Toronto Zoology
SunOS 4.1.1 are all true."  -D. Harrison|  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.lang.c mailing list