GNOME Bugzilla – Bug 764119
rtpmanager: Set to initial value for 'ntpns' in get_current_times()
Last modified: 2016-03-29 07:24:30 UTC
In OE-build process for gst-plugins-good, configure of build script(--enable-fatal-warnings) has to check initial value for variable. So I set up "ntpns" variable initialized to zero.
Created attachment 324652 [details] [review] rtpmanager: Set to initial value for 'ntpns' in get_current_times()
Comment on attachment 324652 [details] [review] rtpmanager: Set to initial value for 'ntpns' in get_current_times() Can you paste the complete compiler warning here? This looks like a complete failure by the compiler, it seems like all paths are obviously initialized?
/gst-plugins-good/gst/rtpmanager/gstrtpbin.c: In function 'gst_rtp_bin_handle_sync': |/gst-plugins-good/gst/rtpmanager/gstrtpbin.c:1213:31: etnrror: 'ntpns' may be used uninitialized in this function [-Werror=maybe-uninitialized] | ntpdiff = local_ntpnstime - ntpnstime; | ^ | gst-plugins-good/gst/rtpmanager/gstrtpbin.c:1004:11: note: 'ntpns' was declared here | guint64 ntpns; | ^ | make -C wavparse
when compile with --enable-fatal-warnings in OE build, If it is not initialized, this options always show this error. so I think that it has to need zero initialized.
| gst-plugins-good/gst/rtpmanager/gstrtpsession.c: In function 'get_current_times': | gst-plugins-good/gst/rtpmanager/gstrtpsession.c:963:16: error: 'ntpns' may be used uninitialized in this function [-Werror=maybe-uninitialized] | *ntpnstime = ntpns; | ^ | cc1: all warnings being treated as errors | make[3]: *** [libgstrtpmanager_la-gstrtpsession.lo] Error 1 | make[3]: *** Waiting for unfinished jobs....
It should be initialized to -1 if anything, but I don't understand how your compiler thinks it could be uninitialized. Please also report that to whoever patched the OE compiler :) If you update the patch to initialize it to -1, I'll merge it.
Created attachment 324854 [details] [review] rtpmanager: Set to initial value for 'ntpns' in get_current_times()
I updated the patch to initialize it to -1.
Created attachment 324856 [details] [review] rtpmanager: Set to initial value for 'ntpns' in get_current_times()
Attachment 324856 [details] pushed as eb13a1d - rtpmanager: Set to initial value for 'ntpns' in get_current_times()