[Info-vax] Possible C compiler static variable initialization problem.
JF Mezei
jfmezei.spamnot at vaxination.ca
Wed Feb 26 16:57:31 EST 2014
I was under the impression that variables defined in a file outside a
function were local to that compilation unit, but available to all
fundtions within that compilation unit.
if you use "global" or "extern" when defining the variable, then this
causes the variable name to be published to the linker to allow the
variable storage to be shared between all object modules being linked
into the executable. If I remember, global defined the storage, extern
told the compiler that storage was defined by someone else and to let
the linker resolve it.
Is this correct ? Or am I off ?
More information about the Info-vax
mailing list