Extern variables question

Dan Mick dan at charyb.COM
Sat Nov 18 05:41:51 AEST 1989


In article <89320.012957CMH117 at PSUVM.BITNET> CMH117 at PSUVM.BITNET (Charles Hannum) writes:
>You should define a global variable in *exactly one* module, no more, no less.
>All other modules should refer to it as an extern.  Most linkers will generate
>an error if a global variable by the same name is defined in more than one
>module.

Again:  What?

Most PC linkers I've used will; but not Microsoft's, at least not with C 
5.1, and *no* Unix linker I've ever heard of does.  That seems, to me, to
be one of the huge implementation-philosophy differences between Unix-oid
C and PC-oid C.
-- 
.sig files are idiotic and wasteful.



More information about the Comp.lang.c mailing list