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 761094 - unintialized variable warnings (gcc 5.1)
unintialized variable warnings (gcc 5.1)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other All
: Normal normal
: 1.7.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-25 16:39 UTC by Víctor Manuel Jáquez Leal
Modified: 2016-01-27 12:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix unintialized variable warnings (1.48 KB, patch)
2016-01-25 16:39 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2016-01-25 16:39:27 UTC
While cross-compiling with Linaro GCC 5.1-2015.08, it complained
about a couple unitialized variables.

This patch initializes them to zero.
Comment 1 Víctor Manuel Jáquez Leal 2016-01-25 16:39:30 UTC
Created attachment 319691 [details] [review]
fix unintialized variable warnings
Comment 2 Sebastian Dröge (slomo) 2016-01-25 17:28:56 UTC
What are the actual compiler warnings? Does it point at the lines where it's possibly used uninitialized?

Would be good to know to check if it's really just a false warning, or if there's a control flow problem in the code.
Comment 3 Víctor Manuel Jáquez Leal 2016-01-25 17:48:18 UTC
gstrtph261pay.c: In function 'gst_rtp_h261_packetize_and_push':
gstrtph261pay.c:797:7: error: 'num_gobs' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   gobs[num_gobs - 1].endpos = len * 8;
       ^
gstrtph261pay.c:870:8: note: 'num_gobs' was declared here
   gint num_gobs;
        ^
cc1: all warnings being treated as errors
Makefile:1232: recipe for target 'libgstrtp_la-gstrtph261pay.lo' failed
make[4]: *** [libgstrtp_la-gstrtph261pay.lo] Error 1
make[4]: Leaving directory '/opt/src/buildroot/output/build/gst1-plugins-good-custom/gst/rtp'
Makefile:838: recipe for target 'rtp' failed
make[3]: *** [rtp] Error 2
make[3]: *** Waiting for unfinished jobs....
In file included from /opt/src/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/gstreamer-1.0/gst/gst.h:54:0,
                 from /opt/src/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/gstreamer-1.0/gst/tag/tag.h:25,
                 from qtdemux.c:55:
qtdemux.c: In function 'qtdemux_parse_cenc_aux_info.constprop':
/opt/src/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/gstreamer-1.0/gst/gstinfo.h:545:5: error: 'n_subsamples' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
     ^
qtdemux.c:3248:13: note: 'n_subsamples' was declared here
     guint16 n_subsamples;
             ^
cc1: all warnings being treated as errors
Makefile:725: recipe for target 'libgstisomp4_la-qtdemux.lo' failed
make[4]: *** [libgstisomp4_la-qtdemux.lo] Error 1
Comment 4 Víctor Manuel Jáquez Leal 2016-01-25 17:48:55 UTC
compilers are getting grumpier...
Comment 5 Sebastian Dröge (slomo) 2016-01-27 12:46:19 UTC
I'd argue that this is a broken compiler, also doesn't happen with normal gcc 5.1 it seems. False warning in any case :)

Let's get your patch in then.
Comment 6 Sebastian Dröge (slomo) 2016-01-27 12:48:01 UTC
commit e1834d151286400426a07f33effde25f4e14cd0b
Author: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Date:   Mon Jan 25 17:21:24 2016 +0100

    gst: Fix unintialized variable warnings
    
    While cross-compiling with Linaro GCC 5.1-2015.08, it complained
    about a couple unitialized variables.
    
    This patch initializes them to zero.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761094