GNOME Bugzilla – Bug 761094
unintialized variable warnings (gcc 5.1)
Last modified: 2016-01-27 12:48:21 UTC
While cross-compiling with Linaro GCC 5.1-2015.08, it complained about a couple unitialized variables. This patch initializes them to zero.
Created attachment 319691 [details] [review] fix unintialized variable warnings
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.
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
compilers are getting grumpier...
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.
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