.bss section and uninitialised variables

Paul Koning pkoning@equallogic.com
Wed Dec 22 14:55:00 GMT 2004


>>>>> "Kevin" == Kevin Puetz <puetzk@puetzk.org> writes:

 Kevin> In C/C++/most languages, you should not make any assumption
 Kevin> about the initial value of variables - it is undefined by the
 Kevin> language, and usually undefined on the platform as well. 

Huh?  Last I heard, file or global scope variables are defined to be
initially zero unless otherwise initialized, that's why they are
supposed to go to .bss.

What you said is correct for automatic variables, though.

     paul



More information about the Gcc mailing list