GNOME Bugzilla – Bug 769116
Build failure with -O3 in Ubuntu 16.04
Last modified: 2016-07-24 11:44:15 UTC
gst-plugins-bad/siddec fail to build with master and 1.9.1 when -O3 is turned on. $ make V=1 CXXFLAGS="-O3" /bin/bash ../../libtool --tag=CXX --tag=disable-static --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -pthread -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gst-plugins-base/gst-libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../gst-libs -I../../gst-libs -pthread -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DG_THREADS_MANDATORY -DG_DISABLE_DEPRECATED -Wall -Wmissing-declarations -Wredundant-decls -Wwrite-strings -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Werror -Wno-non-virtual-dtor -g -DGST_DISABLE_DEPRECATED -O3 -MT libgstsid_la-gstsiddec.lo -MD -MP -MF .deps/libgstsid_la-gstsiddec.Tpo -c -o libgstsid_la-gstsiddec.lo `test -f 'gstsiddec.cc' || echo './'`gstsiddec.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -pthread -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gst-plugins-base/gst-libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../gst-libs -I../../gst-libs -pthread -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/home/jep/gst/master/gstreamer -I/home/jep/gst/master/gstreamer/libs -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DG_THREADS_MANDATORY -DG_DISABLE_DEPRECATED -Wall -Wmissing-declarations -Wredundant-decls -Wwrite-strings -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Werror -Wno-non-virtual-dtor -g -DGST_DISABLE_DEPRECATED -O3 -MT libgstsid_la-gstsiddec.lo -MD -MP -MF .deps/libgstsid_la-gstsiddec.Tpo -c gstsiddec.cc -fPIC -DPIC -o .libs/libgstsid_la-gstsiddec.o gstsiddec.cc: In function ‘void play_loop(GstPad*)’: gstsiddec.cc:428:38: error: ‘value’ may be used uninitialized in this function [-Werror=maybe-uninitialized] GST_BUFFER_OFFSET_END (out) = value; ^ gstsiddec.cc:433:37: error: ‘time’ may be used uninitialized in this function [-Werror=maybe-uninitialized] GST_BUFFER_DURATION (out) = value - time; ^ gstsiddec.cc:413:35: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized] GST_BUFFER_OFFSET (out) = offset; ^ cc1plus: all warnings being treated as errors Makefile:622: recipe for target 'libgstsid_la-gstsiddec.lo' failed make: *** [libgstsid_la-gstsiddec.lo] Error 1
Created attachment 332034 [details] [review] sidplay: fix compiler warnings when building with -O3 Avoid compiler warnings "‘foo’ may be used uninitialized in this function" when building with -O3 by checking the return bool value of format conversion function.
Comment on attachment 332034 [details] [review] sidplay: fix compiler warnings when building with -O3 commit 9b6b6d1fd52839008635d38c82662d544a70a4ed Author: Josep Torra <n770galaxy@gmail.com> Date: Sun Jul 24 10:00:48 2016 +0200 sidplay: fix compiler warnings when building with -O3 Avoid compiler warnings "‘foo’ may be used uninitialized in this function" when building with -O3 by checking the return bool value of format conversion function. https://bugzilla.gnome.org/show_bug.cgi?id=769116