On Sun, 28 Jan 2001, Alexander Mai uttered the following:
> On 27 Jan 2001 23:57:25 +0000, Nix wrote:
> 
>>On 24 Jan 2001, Danny Backx yowled:
>>> Doesn't the C language specify that global un-initialised data is always set to 
>>> 0 ?
>>
>>Variables with static linkage (global or local, it doesn't matter) are
>>zero-initialized.
> 
> I guess we all benefit from doing initialization in all case explicitly.

It is inefficient to explicitly initialize static storage to zero; it
bloats up the data section. (Not very inefficient, at four bytes per
explicit initialization, but still...)

I'm not sure why GCC doesn't optimize that away, myself.

> Yesterday I "fixed" some uninitialized "library-global" vars by initializing
> to 0. I don't think it has ever hurt actually,

If it hurts your C compiler/OS is very, *very* broken. It increased the
size of the binary, and that's all it did.

-- 
`Anyhow, that pipe dream doesn't say anything about the question you
 asked.  (I am planning for a career in politics.)' --- Mark Mitchell
                                                      on the GCC list

Reply via email to