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 661546 - Wrong declaration of GUINT_TO_POINTER in 32 bits
Wrong declaration of GUINT_TO_POINTER in 32 bits
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-10-12 12:45 UTC by Lucas De Marchi
Modified: 2011-11-17 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix cast (806 bytes, patch)
2011-10-12 12:45 UTC, Lucas De Marchi
committed Details | Review

Description Lucas De Marchi 2011-10-12 12:45:02 UTC
Created attachment 198846 [details] [review]
Fix cast

If we don't do the cast to the proper size in 32 bits, things like below
doesn't work:

uint8_t u = 20;
void *p;

p = GUINT_TO_POINTER(u);
Comment 1 Lucas De Marchi 2011-11-16 14:28:06 UTC
CC'ing people that changed similar lines.
Comment 2 Colin Walters 2011-11-16 15:46:51 UTC
Review of attachment 198846 [details] [review]:

Looks right to me.  Arguably people should have been doing GUINT_TO_POINTER((guint)u) but there's no reason to force them to.
Comment 3 Christian Persch 2011-11-17 13:12:29 UTC
Reopening. 

This commit breaks the build; it needs to be reverted.
Comment 4 Christian Persch 2011-11-17 13:24:59 UTC
I fixed the breakage on master.
Comment 5 Andrés G. Aragoneses (IRC: knocte) 2011-11-17 13:38:02 UTC
With the "breakage", were you guys referring to bug 664236?