global data in C (follow-up)

Alan J Rosenthal flaps at dgp.toronto.edu
Fri Mar 25 13:45:54 AEST 1988


In article <7523 at ncoast.UUCP> btb at ncoast.UUCP (Brad Banko) writes:
>perhaps a good extension to C would be a "global" type declaration:
>global (data declarator)
>which would tell the compiler and linker that the referenced data should
>be stored in only one common place.

This was what dmr originally wanted "extern" to mean, which I believe
accounts for the double meanings of "extern" and "static" as they are
used today.

You can see remnants of this idea in the discussion of "extern" in
various places in K&R; for example, it says that extern is the default
storage class for variables declared outside of functions, implying
that "int a" and "extern int a" are the same when written outside of
functions.

The original idea of extern was modified in the face of non-unix
stubborn linkers.

ajr
-- 
If you had eternal life, would you be able to say all the integers?



More information about the Comp.lang.c mailing list