After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623295 - with -O3 building fails due to "xxx may be used uninitialized in this function"
with -O3 building fails due to "xxx may be used uninitialized in this function"
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: building
unspecified
Other Linux
: Normal minor
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-07-01 14:57 UTC by christian.h.m.schramm
Modified: 2010-07-12 19:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[St] fix a bug noticed by gcc -O3 (727 bytes, patch)
2010-07-12 18:25 UTC, Dan Winship
committed Details | Review

Description christian.h.m.schramm 2010-07-01 14:57:44 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 ...).
Comment 1 Dan Winship 2010-07-01 15:08:53 UTC
the code is wrong anyway, it's just that the compiler doesn't manager to figure it out without -O3
Comment 2 Dan Winship 2010-07-12 18:25:06 UTC
Created attachment 165753 [details] [review]
[St] fix a bug noticed by gcc -O3
Comment 3 Owen Taylor 2010-07-12 18:38:17 UTC
Review of attachment 165753 [details] [review]:

Looks obviously right
Comment 4 Dan Winship 2010-07-12 19:56:25 UTC
Attachment 165753 [details] pushed as 1b03d5c - [St] fix a bug noticed by gcc -O3