build fails with very recent gcc 4.6: unused-but-set-variable error

Bug #706703 reported by Adam Williamson
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
BAMF
Confirmed
Wishlist
Unassigned
Unity
Invalid
Wishlist
Unassigned
unity-2d
Invalid
Undecided
Unassigned
bamf (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

After Fedora went to a snapshot of GCC 4.6 trunk from Jan 22nd, build of bamf stopped working. It hits an unused-but-set-variable error in lib/libbamf/bamf-view.c 's bamf_view_set_property function, which is treated as an error by the use of strict compiler options in bamf's build.

bamf-view.c: In function 'bamf_view_set_property':
bamf-view.c:543:13: error: variable 'self' set but not used [-Werror=unused-but
-set-variable]
cc1: all warnings being treated as errors

Tags: patch
Alex Launi (alexlauni)
Changed in bamf:
status: New → Confirmed
Changed in bamf (Ubuntu):
status: New → Confirmed
Changed in bamf:
importance: Undecided → Wishlist
Changed in unity:
status: New → Confirmed
importance: Undecided → Wishlist
Changed in bamf (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Adam Dingle (adam-yorba) wrote :

Here's a patch that fixes the build errors, assuming that you want to stay with GNOME_COMPILE_WARNINGS(maximum) and fix all these errors in place.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 706703] Re: build fails with very recent gcc 4.6: unused-but-set-variable error

Thanks Adam, that's much appreciated!

tags: added: patch
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Adam, thanks for your patch :)

The patch looks good, I'll just ask for Jason for a second look, I think we can remove other parts like:
- matcher = bamf_matcher_get_default ();
- control = bamf_control_get_default ();
- source = g_object_new (BAMF_TYPE_TAB_SOURCE, "id", "testingsource", NULL);
+ bamf_matcher_get_default ();
+ bamf_control_get_default ();
+ g_object_new (BAMF_TYPE_TAB_SOURCE, "id", "testingsource", NULL);

-> if we don't reference them, there is no need at all for those calls or objects ;)

Jason?

Changed in bamf:
assignee: nobody → Jason Smith (jassmith)
Changed in unity-2d:
status: New → Confirmed
Changed in unity-2d:
status: Confirmed → Invalid
Changed in unity-2d:
status: Invalid → Confirmed
Changed in unity-2d:
status: Confirmed → Invalid
Omer Akram (om26er)
Changed in unity:
status: Confirmed → Invalid
Changed in bamf:
assignee: Jason Smith (jassmith) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.