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 528081 - Warnings in EEL_ASSIGN_MUST_OVERRIDE_SIGNAL with GCC 4.3.0
Warnings in EEL_ASSIGN_MUST_OVERRIDE_SIGNAL with GCC 4.3.0
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: [obsolete] Builds
2.22.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-14 18:18 UTC by Paweł Paprota
Modified: 2008-05-05 14:36 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Trivial patch - initialize two variables. (496 bytes, patch)
2008-04-14 18:22 UTC, Paweł Paprota
committed Details | Review
fno-strict-aliasing (453 bytes, patch)
2008-05-02 12:40 UTC, A. Walton
none Details | Review

Description Paweł Paprota 2008-04-14 18:18:21 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
Comment 1 Paweł Paprota 2008-04-14 18:22:00 UTC
Created attachment 109255 [details] [review]
Trivial patch - initialize two variables.
Comment 2 Paweł Paprota 2008-04-14 18:27:53 UTC
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
Comment 3 Cosimo Cecchi 2008-04-15 09:48:02 UTC
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.
Comment 4 A. Walton 2008-05-02 12:40:03 UTC
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
Comment 5 Christian Neumair 2008-05-03 12:56:31 UTC
Thanks, please commit the patch to trunk and to the GNOME 2.22 branch.
Comment 6 A. Walton 2008-05-05 14:36:17 UTC
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.