[PATCH 28/44] xfree86/dri: Mark DRIDrvMsg and dri_drm_debug_print _X_ATTRIBUTE_PRINTF

Mouse mouse at Rodents-Montreal.ORG
Fri Dec 13 17:32:04 PST 2013


>> Hooray for LP64.  These need to be (void *) (uintptr_t) foo.

Actually, I suspect there is a semantic bug here.  If the integers are
smaller than pointers, they don't have as much information content as
pointers, so forcibly shoehorning them into pointers with the help of
additional casts is almost certain to be a wrong thing.

If this is just for printing, as implied elsewhere in the thread, I
think changing the printf format is a much better fix (I'd guess %u or
%#x instead of %p - I haven't dug up the original code).  If nothing
else, casting them to void * to print implies they're "really" pointers
to someone reading the code, which they'd better not be if they're
being kept in 32-bit ints on 64-bit-pointer architectures.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse at rodents-montreal.org
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


More information about the xorg-devel mailing list