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 793592 - rtp-server: compilation error with clang
rtp-server: compilation error with clang
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
unspecified
Other All
: Normal normal
: 1.13.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-19 11:00 UTC by Víctor Manuel Jáquez Leal
Modified: 2018-02-19 20:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtp-server: remove redefined variable (974 bytes, patch)
2018-02-19 11:00 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2018-02-19 11:00:56 UTC
When compiling with clang this compilation error is raised:

Making all in rtsp-server
make[3]: Entering directory '/opt/gst/master/gst-rtsp-server/gst/rtsp-server'
  CC       libgstrtspserver_1.0_la-rtsp-onvif-media.lo
rtsp-onvif-media.c:103:16: error: variable 'res' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    } else if (!sinkpad && !gst_caps_is_fixed (caps)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtsp-onvif-media.c:111:17: note: uninitialized use occurs here
    for (j = 0; res && j < n_caps; j++) {
                ^~~
rtsp-onvif-media.c:103:12: note: remove the 'if' if its condition is always true
    } else if (!sinkpad && !gst_caps_is_fixed (caps)) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtsp-onvif-media.c:103:16: error: variable 'res' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized]
    } else if (!sinkpad && !gst_caps_is_fixed (caps)) {
               ^~~~~~~~
rtsp-onvif-media.c:111:17: note: uninitialized use occurs here
    for (j = 0; res && j < n_caps; j++) {
                ^~~
rtsp-onvif-media.c:103:16: note: remove the '&&' if its condition is always true
    } else if (!sinkpad && !gst_caps_is_fixed (caps)) {
               ^~~~~~~~~~~
rtsp-onvif-media.c:82:17: note: initialize the variable 'res' to silence this warning
    gboolean res;
                ^
                 = 0
2 errors generated.
Comment 1 Víctor Manuel Jáquez Leal 2018-02-19 11:00:59 UTC
Created attachment 368553 [details] [review]
rtp-server: remove redefined variable

res is a boolean variable which is defined in the function scope and
redefined, with no reason, in the loop scope. This patch removes the
redefinition.
Comment 2 Tim-Philipp Müller 2018-02-19 14:14:23 UTC
Comment on attachment 368553 [details] [review]
rtp-server: remove redefined variable

Thanks. I think you should feel free to push things like that directly in future without a bug report, if you want to.
Comment 3 Víctor Manuel Jáquez Leal 2018-02-19 20:28:08 UTC
Attachment 368553 [details] pushed as b7e8198 - rtp-server: remove redefined variable