.bss section and uninitialised variables

Eric Botcazou ebotcazou@libertysurf.fr
Wed Dec 22 14:50:00 GMT 2004


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

It turns out that this is not true for Gisle's testcase: C99 explicitly says 
that 'myvar' must be initialized to 0 at run-time (C99 6.7.8 §10).

Gisle simply missed the -fcommon/-fno-common subtlety.

-- 
Eric Botcazou



More information about the Gcc mailing list