GNOME Bugzilla – Bug 623295
with -O3 building fails due to "xxx may be used uninitialized in this function"
Last modified: 2010-07-12 19:56:27 UTC
Just out of curiosity I tried to build gnome-shell with "-O3" compiler option. jhbuild quit with this error: make[3]: Entering directory `/home/christian/gnome-shell/source/gnome-shell/src' CC libst_1_0_la-st-box-layout.lo cc1: warnings being treated as errors st/st-box-layout.c: In Funktion »st_box_layout_get_property«: st/st-box-layout.c:211: Fehler: »adjustment« may be used uninitialized in this function [...] When initialized the variable with 0 it silenced this particular warning, but other unitialized variables warnings popped up. I have no idea of C at all, so I don't know how to solve it correctly (initialize all with null?). I guess the problem is that with "-O3" GCC tries to inline these functions, which changes the program flow. Might be no big deal if you think that noone will ever build GS with "-O3" (but the gentoo guys will surely complain ...).
the code is wrong anyway, it's just that the compiler doesn't manager to figure it out without -O3
Created attachment 165753 [details] [review] [St] fix a bug noticed by gcc -O3
Review of attachment 165753 [details] [review]: Looks obviously right
Attachment 165753 [details] pushed as 1b03d5c - [St] fix a bug noticed by gcc -O3