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: bss section not getting zero-initialised vars


Jeffrey A Law wrote:
> You might think that's not a good reason, but initializing a variable
> to zero to force it into .data so that it can be edited with adb,
> emacs, etc has been standard procedure on Unix systems for 20 years, I
> don't think we should change it.  We did this kind of thing all the
> time in the BSD kernels.

Seeing as Emacs reckons that trick is "portable", right up to the most
recent version, I guess we'd better keep it that way.

A switch which defaults to off is a possibility.  Maybe turned on by -Os?

Of course you're thinking that all real programs simply leave a variable
uninitialised if they want a zero, so why would it be an issue?  Well,
maybe there are programs which initialise to a calculated value, which
may or may not be zero.

-- Jamie

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