This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Automaticly eliminating redundant zero initialisers
- To: george at pioneer dot net
- Subject: Re: Automaticly eliminating redundant zero initialisers
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Mon, 1 May 2000 14:54:39 +0200
- CC: tigran at veritas dot com, greyham at research dot canon dot com dot au, rmk at arm dot linux dot org dot uk, linux-kernel at vger dot rutgers dot edu, gcc at gcc dot gnu dot org
- References: <Pine.LNX.4.21.0005011126350.1079-100000@saturn.homenet> <390D6ABD.CCC9956D@pioneer.net>
> 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