GNOME Bugzilla – Bug 634225
Gnome-shell doesn't build with -O3
Last modified: 2010-11-20 19:16:11 UTC
Created attachment 173992 [details] [review] Patch to fix the build At least using gcc 4.5.1, gnome-shell fails to build because of some variables not being unintialized when compiling with -O3.
Created attachment 174451 [details] [review] StThemeNode: suppress compiler warnings and fix minor bugs Hmm. Not that I would _recommend_ building the shell (or anythign else) with -O3 but the added initializations seem in line with ones that already exist for warnings that show up with -O2 so we can add them. I think it's always good to mark warning-suppression assignments as such, and I found a couple of bugs in the logic when double-checking that the warnings you were getting were in fact fake. So here's my attempt at a patch. (I also added initializations for the weight variables where you weren't getting a warning for some reason to keep things consistent.)
Comment on attachment 174451 [details] [review] StThemeNode: suppress compiler warnings and fix minor bugs The bugfixy parts definitely look right. The initializations definitely look unnecessary. Some investigation reveals that it's a known bug that gcc can't figure the "foo_set" trick, but maybe it will be fixed in gcc 4.6. (http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00706.html)
If GCC 4.6 fixes that, that would be a real advance. I've been inserting bogus initializations for this type of pattern forever. Attachment 174451 [details] pushed as 1fce237 - StThemeNode: suppress compiler warnings and fix minor bugs