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 567225 - volatile gonce_data in BOILERPLATE not initialized to 0
volatile gonce_data in BOILERPLATE not initialized to 0
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.10.22
Assigned To: Sebastian Dröge (slomo)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-10 01:33 UTC by Olivier Crête
Modified: 2009-01-11 09:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
once-init.diff (805 bytes, patch)
2009-01-10 10:32 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Olivier Crête 2009-01-10 01:33:31 UTC
the gonce_data in the BOILERPLATE should be initialized to 0, otherwise the retval may be bogus.
Comment 1 Sebastian Dröge (slomo) 2009-01-10 10:32:04 UTC
Created attachment 126160 [details] [review]
once-init.diff

We should get this in the next release
Comment 2 Tim-Philipp Müller 2009-01-10 17:22:38 UTC
Aren't static variables always automatically initialised to zero (as per e.g. ISO/IEC 1999 C 6.2.4 and 6.7.8)? I've never heard of a compiler that doesn't do that. Not that it hurts to do it either ..
Comment 3 David Schleef 2009-01-10 18:47:39 UTC
Tim speaks the truth.  This patch is a matter of style, although one that I happen to agree with.
Comment 4 Sebastian Dröge (slomo) 2009-01-11 09:46:38 UTC
2009-01-11  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

        * gst/gstutils.h:
        Initialize g_once_init* data with 0. Fixes bug #567225.