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 141024 - gtkselection.c: gtk_selection_convert - warning about deferencing type-punned pointer breaking strict aliasing rules
gtkselection.c: gtk_selection_convert - warning about deferencing type-punne...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.4.x
Other Linux
: Normal normal
: Small fix
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-04-24 18:39 UTC by Chris Sherlock
Modified: 2013-08-14 02:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (51.86 KB, patch)
2004-04-24 18:40 UTC, Chris Sherlock
none Details | Review
Proposed patch.... (685 bytes, patch)
2004-04-24 18:56 UTC, Chris Sherlock
none Details | Review

Description Chris Sherlock 2004-04-24 18:39:03 UTC
gtk_selection_convert fixed to prevent warning by gcc about it breaking strict
aliasing rules. Happens because gdk_window_get_user_data is expecting parameter
2 of function to be a gpointer*, however it's getting a GtkWidget.

Fixed by creating a gpointer variable powner_widget for use in
gdk_window_get_user_data, then assign it's address to GtkWidget *owner_widget.
Comment 1 Chris Sherlock 2004-04-24 18:40:01 UTC
Created attachment 27046 [details] [review]
Proposed patch
Comment 2 Chris Sherlock 2004-04-24 18:56:08 UTC
Created attachment 27048 [details] [review]
Proposed patch....

Er, oops. I accidently uploaded the wrong file!
Comment 3 Owen Taylor 2004-05-04 21:04:00 UTC
+      gdk_window_get_user_data (owner_window, (gpointer *)&powner_widget);
                                                ^^^^^^^^^^^
                                                not needed
+
+      owner_widget = (GtkWidget*)&powner_widget;
                                  ^
                           highly harmful
Comment 4 Chris Sherlock 2004-05-05 11:51:19 UTC
Er... ok... back to the drawing board then :)

Close? If it's a bad patch or not needed it might be for the best. 
Comment 5 Martin Ammermüller 2006-08-18 11:52:17 UTC
Is this still an issue?