[hatari-devel] Debugger crash changes / zeroing global variables

Eero Tamminen oak at helsinkinet.fi
Sat Jan 14 16:53:46 CET 2012


Nicolas, what are these changes:

Uninitialized global variables are already zero.  Or your compiler
is buggy, as C specification states that:
If an object that has static storage duration is not initialized explicitly, 

if it has pointer type, it is initialized to a null pointer;
if it has arithmetic type, it is initialized to (positive or unsigned) zero;
if it is an aggregate, every member is initialized (recursively) according 
to these rules;
if it is a union, the first named member is initialized (recursively) 
according to these rules.

Explicitly setting global variables to NULL/zero/false, may move the
variables from (initially zeroed) BSS to DATA section and increase
the binary size minimally, it doesn't change the values of those
variables as they already were zero.  See also:

I.e. I think there's some other problem that you just hid.

	- Eero

More information about the hatari-devel mailing list