GNOME Bugzilla – Bug 141068
demos/gtk-demo/changedisplay.c: find_toplevel_at_pointer - warning: dereferencing type-punned pointer will break strict-aliasing rules
Last modified: 2013-02-11 05:21:50 UTC
find_toplevel_at_pointer fixed to prevent warning by gcc about it breaking strict aliasing rules. Happens because gdk_window_get_user_data is expecting parameter 2 to be a gpointer*, however it's getting a GtkWidget. Fixed by creating a gpointer variable pwidget for use in gdk_window_get_user_data, then assign it's address to GtkWidget *widget.
Created attachment 27070 [details] [review] Proposed patch
patch still applies and fixes a warning
Patch introduces an error on this line: + widget = (GtkWidget*)&pwidget; widget is double-anded from the gpointer.
Didn't mean to change bug status, sorry.
closing old bugs; no point in keeping bugs about compiler warnings open for years