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 754214 - unused variable warnings
unused variable warnings
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-28 01:36 UTC by Young Han Lee
Modified: 2015-08-28 07:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
suggested patch (3.69 KB, patch)
2015-08-28 01:39 UTC, Young Han Lee
rejected Details | Review

Description Young Han Lee 2015-08-28 01:36:34 UTC
Some variables are used only in assert statements and cause compile warnings when NDEBUG is given.

sprinkle.c:212:12: error: variable ‘linked’ set but not used [-Werror=unused-but-set-variable]
sprinkle3.c:244:12: error: variable ‘res’ set but not used [-Werror=unused-but-set-variable]
sprinkle2.c:231:12: error: variable ‘res’ set but not used [-Werror=unused-but-set-variable]
test-overlay-blending.c:94:20: error: variable ‘decomp_res’ set but not used [-Werror=unused-but-set-variable]
Comment 1 Young Han Lee 2015-08-28 01:39:09 UTC
Created attachment 310147 [details] [review]
suggested patch

Suggested patch.
Comment 2 Vineeth 2015-08-28 01:44:50 UTC
Hi..
please refer to https://bugzilla.gnome.org/show_bug.cgi?id=752604

As per comments from Tim,
if --disable-gst-debug is used, you should also use --disable-fatal-warnings.
Comment 3 Young Han Lee 2015-08-28 02:00:51 UTC
Thank you for your guide.

Yes, I got these errors while trying to enable fatal warnings option on product mode. Do you know why gstreamer uses it only in debug mode?


(In reply to Vineeth from comment #2)
> Hi..
> please refer to https://bugzilla.gnome.org/show_bug.cgi?id=752604
> 
> As per comments from Tim,
> if --disable-gst-debug is used, you should also use --disable-fatal-warnings.
Comment 4 Sebastian Dröge (slomo) 2015-08-28 07:07:46 UTC
Releases are built without assertions, that's why these variables are now considered unused. The g_assert() that uses them is a noop in releases (and current GIT master has a release version number: 1.5.90, and not a GIT version number 1.5.90.1).


For debug output, it's basically the same story. Adding noise to the code for making these unused variable compiler warnings disappear when debugging (or assertions) are disabled is not worth it and will only make the code less readable. -Werror is only supposed to be used for builds from GIT with debug output and assertions enabled.