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 752747 - Fix error on release builds when compiling with "-Werror=unused-but-set-variable".
Fix error on release builds when compiling with "-Werror=unused-but-set-varia...
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-22 23:36 UTC by darren.garvey
Modified: 2015-07-29 07:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix error on release builds when compiling with "-Werror=unused-but-set-variable". (844 bytes, patch)
2015-07-22 23:36 UTC, darren.garvey
rejected Details | Review

Description darren.garvey 2015-07-22 23:36:47 UTC
Created attachment 307944 [details] [review]
Fix error on release builds when compiling with "-Werror=unused-but-set-variable".

This is a simple fix for release builds where the `assert(had_client)` call is compiled out and as such `had_client` is unused but set.
Comment 1 Tim-Philipp Müller 2015-07-23 09:17:54 UTC
I don't think we should uglify the code like this to support building releases with -Werror :)
Comment 2 darren.garvey 2015-07-29 01:24:25 UTC
That's a pity, as building from git does use -Werror which makes this a hard compilation error.

It's not the prettiest pattern, but it is a "standard" one and one used widely throughout the codebase, not just in -bad. I figured putting #ifdefs around the place would be way uglier in this case and the only clean alternative I see is to remove the assert (and use of had_client) entirely.
Comment 3 darren.garvey 2015-07-29 01:31:56 UTC
Is it less ugly without the comment? ;)
Comment 4 Tim-Philipp Müller 2015-07-29 07:47:40 UTC
Perhaps I misunderstood.

My understanding was this:

 - you are building a release (not git version)

 - releases use -DG_DISABLE_ASSERT by default

 - this causes the mentioned compiler warning

 - you are adding -Werror=* flags yourself
   (releases do not use -Werror, only git)