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 789983 - gstdevicemonitor: Avoid maybe-uninitialized error
gstdevicemonitor: Avoid maybe-uninitialized error
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-06 19:50 UTC by Jan Alexander Steffens (heftig)
Modified: 2017-12-04 10:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] gstdevicemonitor: Avoid maybe-uninitialized error (2.36 KB, patch)
2017-11-06 19:50 UTC, Jan Alexander Steffens (heftig)
committed Details | Review

Description Jan Alexander Steffens (heftig) 2017-11-06 19:50:18 UTC
Created attachment 363075 [details] [review]
[PATCH] gstdevicemonitor: Avoid maybe-uninitialized error

On Arch Linux x86_64, gcc 7.2.0-3, -Og -g3:

gstdevicemonitor.c: In function ‘bus_sync_message’:
gstdevicemonitor.c:276:8: error: ‘matches’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

This commit also simplifies the code a bit.



I gave up on attempting to compile without --disable-fatal-warnings after encountering way too many of them in gst-plugins-good.
Comment 1 Tim-Philipp Müller 2017-12-04 10:58:16 UTC
Thanks, pushed with modifications - I wasn't entirely convinced that inverting the hidden check makes the code clearer. Hope you don't mind :)

commit d9b20492f328cd89b618de00374e6999ddf45876 (HEAD -> master)
Author: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Date:   Mon Nov 6 20:23:12 2017 +0100

    devicemonitor: Avoid maybe-uninitialized compiler warning
    
    On Arch Linux x86_64, gcc 7.2.0-3, -Og -g3:
    
    gstdevicemonitor.c: In function ‘bus_sync_message’:
    gstdevicemonitor.c:276:8: error: ‘matches’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    
    This commit also simplifies the code a bit.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789983