GNOME Bugzilla – Bug 141069
Bug 141068: demos/gtk-demo/textview.c: easter_egg_callback - warning: dereferencing type-punned pointer will break strict-aliasing rules
Last modified: 2010-12-17 06:01:48 UTC
easter_egg_callback fixed to prevent warning by gcc about it breaking strict aliasing rules. Happens because g_object_add_weak_pointer is expecting parameter 2 to be a gpointer*, however it's getting a GtkWidget. Fixed by creating a gpointer variable pwindow for use in gdk_window_get_user_data, then assign it's address to GtkWidget *window.
Created attachment 27071 [details] [review] Proposed patch
Comment on attachment 27071 [details] [review] Proposed patch You might want to look at the g_object_add_weak_pointer docs - that's not an out parameter, that's the location to clear when the object is destroyed.
Thank you for taking the time to report this bug and helping to make GTK+ better. We are sorry that we do not always have the capacity to look at all reported bugs in a timely manner. There have been many changes in GTK+ since that time you reported the bug and your problem may have been fixed with some of the updates. It would help us a lot if you could test a current, supported, GTK+ version (2.22 or, even better, current master). If you can test it, and it is still an issue, we would appreciate if you could upload any log / test case that are relevant for this particular issue.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!