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 564935 - Warning on g_static_mutex_lock
Warning on g_static_mutex_lock
Status: RESOLVED DUPLICATE of bug 316221
Product: glib
Classification: Platform
Component: gthread
2.18.x
Other All
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-12-17 23:28 UTC by lcid-fire
Modified: 2008-12-17 23:34 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description lcid-fire 2008-12-17 23:28:38 UTC
Please describe the problem:
When I compile a program that uses g_static_mutex_lock it gives me a warning: dereferencing type-punned pointer will break strict-aliasing rules

Steps to reproduce:
1. Set gcc options to "std=c99 -Wall -O2"
2. Add a "static GStaticMutex test_mutex = G_STATIC_MUTEX_INIT;"
3. Add code like "g_static_mutex_lock(&test_mutex);"


Actual results:
Prints the warning: "dereferencing type-punned pointer will break strict-aliasing rules"

Expected results:
No warning should be emitted.

Does this happen every time?
Yes.

Other information:
Comment 1 Behdad Esfahbod 2008-12-17 23:34:35 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 316221 ***