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 769116 - Build failure with -O3 in Ubuntu 16.04
Build failure with -O3 in Ubuntu 16.04
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.9.1
Other Linux
: Normal major
: 1.9.2
Assigned To: Josep Torra Valles
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-23 17:49 UTC by Josep Torra Valles
Modified: 2016-07-24 11:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sidplay: fix compiler warnings when building with -O3 (3.31 KB, patch)
2016-07-24 08:20 UTC, Josep Torra Valles
committed Details | Review

Description Josep Torra Valles 2016-07-23 17:49:53 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
Comment 1 Josep Torra Valles 2016-07-24 08:20:23 UTC
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 2 Josep Torra Valles 2016-07-24 11:43:32 UTC
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