GNOME Bugzilla – Bug 564935
Warning on g_static_mutex_lock
Last modified: 2008-12-17 23:34:35 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:
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 ***