On 28 Jan 2001 14:17:02 +0000, Nix wrote:
>> 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.
Interesting point.
If you don't add the explicit initialization, so I would assume that
on runtime the program has to dig out what kind of variable it is
and then assign the 0 value. Isn't there a trade-off between
memory space and performance?
>> 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.
?
Can't follow here. Those vars were never initialized upon running
main() or loading the libXm, but during some internal Xm routine
deep inside our libXm.
My conclusion that it has never hurt should refer to the code that
does the initialization.
---
Alexander Mai
[EMAIL PROTECTED]