Mail Archives: djgpp/1996/09/19/15:35:47
Samuel Vincent wrote:
> You must forgive me for my disbelief, but how can an "external" variable
> be initialized at all? It's initialized elsewhere, where it is
> defined, not declared (externally declared or not...)
An "external" means an entity declared with external linkage; in other words,
what normally is colloquially called a global.
> As far as static variables go, I don't have that info available, but
> it would make sense to zero it yourself anyway. I believe ANSI says
> absolutely nothing is initialized unless you do it yourself.
Static, static external and external nonconglomerate variables _are_
guaranteed to be zeroed*. I just don't know about conglomerate variables
(i.e., structures or unions).
It is certainly good style to initialize any values that you're counting on,
in any case.
--
* Note that is not always the safest thing. The internal representation of a
null pointer, for instance, is not guaranteed to be all-bits zero by the
standard.
--
Erik Max Francis, &tSftDotIotE http://www.alcyone.com/max/ max AT alcyone DOT com
San Jose, California ICBM 37 20 07 N 121 53 38 W R^4: the 4th R is respect
"Gods are born and die, but the atom endures." -- Alexander Chase
- Raw text -