GNOME Bugzilla – Bug 528081
Warnings in EEL_ASSIGN_MUST_OVERRIDE_SIGNAL with GCC 4.3.0
Last modified: 2008-05-05 14:36:17 UTC
This bug is a "tracking" bug for issues I have with compiling Nautilus using GCC 4.3.0 on Arch Linux. I'll attach patches where suitable. First problem is as follows: cc1: warnings being treated as errors nautilus-file.c: In function 'compare_by_time': nautilus-file.c:2406: error: 'time_1' may be used uninitialized in this function nautilus-file.c:2406: error: 'time_2' may be used uninitialized in this function make[2]: *** [nautilus-file.lo] Error 1 make[2]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk/libnautilus-private' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk' make: *** [all] Error 2
Created attachment 109255 [details] [review] Trivial patch - initialize two variables.
Second problem: cc1: warnings being treated as errors fm-directory-view.c: In function 'fm_directory_view_class_init': fm-directory-view.c:8883: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8884: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8885: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8886: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8887: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8888: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8889: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8890: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8891: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8892: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8893: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8894: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8895: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8896: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8897: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8898: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8899: error: dereferencing type-punned pointer will break strict-aliasing rules fm-directory-view.c:8900: error: dereferencing type-punned pointer will break strict-aliasing rules make[4]: *** [fm-directory-view.lo] Error 1 make[4]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk/src/file-manager' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk' make: *** [all] Error 2 Here I'm not sure about the fix. These errors are caused by following eel macros that I have yet to understand... /* Function pointers that subclasses must override */ EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, add_file); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, bump_zoom_level); ... For now I simply commented it out (together with EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL counterparts). Note, third compilation error is the same as above: cc1: warnings being treated as errors nautilus-navigation-bar.c: In function ‘nautilus_navigation_bar_class_init’: nautilus-navigation-bar.c:98: error: dereferencing type-punned pointer will break strict-aliasing rules nautilus-navigation-bar.c:99: error: dereferencing type-punned pointer will break strict-aliasing rules make[4]: *** [nautilus-navigation-bar.o] Error 1 make[4]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ppawel/projects/nautilus/workspace/nautilus-trunk' make: *** [all] Error 2
Thanks, committed the patch to trunk and gnome-2-22 branch. 2008-04-15 Cosimo Cecchi <cosimoc@gnome.org> * libnautilus-private/nautilus-file.c: (compare_by_time): Initialize two vars to get rid of a warning with gcc 4.3. Patch by Paweł Paprota. (#528081). Reassigning the bug to eel, as the second issue seems to be its fault.
Created attachment 110270 [details] [review] fno-strict-aliasing This looks like a GCC bug actually[1]; we're adding -Wno-strict-aliasing, but GCC 4.3 is silently ignoring us. Using -fno-strict-aliasing forces it to pay more attention. If someone wants to forward a minimized example of this to them so they can fix it, that would be great. But until then, this should fix the build for this target. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34973
Thanks, please commit the patch to trunk and to the GNOME 2.22 branch.
2008-05-05 A. Walton <awalton@gnome.org> * configure.in: Use -Wstrict-aliasing=0 instead of -Wno-strict-aliasing, known to be broken on GCC 4.3.x < r130902 (GCC Bug #34973). Closes GNOME bug #528081. -Wstrict-aliasing=0 was suggested by the GCC team upstream as a better workaround than -fno-strict-aliasing, so I committed that instead. And we're almost building again on the Ibex toolchain (but that's another bug...) Closing as fixed.