This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Automaticly eliminating redundant zero initialisers


> Soon as you depend on this some OS dude will fill bss with -1s so he can
> tell what was used... or some such.  Seems like a bad idea to depend on
> bss being anything at all.

Of course, that OS dude would then break ISO C compatibility for his
system. The C standard requires that globals are zero-initialized
unless they are initialized explicitly. Depending on zero
initialization is as good as depending on initialization at all, at
least in standard C.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]