|
From: <sv...@va...> - 2007-05-01 13:53:02
|
Author: sewardj Date: 2007-05-01 14:53:01 +0100 (Tue, 01 May 2007) New Revision: 1759 Log: Stop gcc-4.2 producing hundreds of complaints of the form "warning: cast from pointer to integer of different size" when compiling on a 64-bit target. gcc-4.2 is correct to complain. An interesting question is why no previous gcc warned about this. Modified: trunk/pub/libvex_basictypes.h Modified: trunk/pub/libvex_basictypes.h =================================================================== --- trunk/pub/libvex_basictypes.h 2007-04-29 10:39:16 UTC (rev 1758) +++ trunk/pub/libvex_basictypes.h 2007-05-01 13:53:01 UTC (rev 1759) @@ -123,7 +123,7 @@ /* This is so useful it should be visible absolutely everywhere. */ #if !defined(offsetof) -# define offsetof(type,memb) ((Int)&((type*)0)->memb) +# define offsetof(type,memb) ((Int)(HWord)&((type*)0)->memb) #endif |
|
From: Dirk M. <dm...@gm...> - 2007-05-03 13:10:59
|
On Tuesday, 1. May 2007, sv...@va... wrote: > /* This is so useful it should be visible absolutely everywhere. */ > #if !defined(offsetof) > -# define offsetof(type,memb) ((Int)&((type*)0)->memb) > +# define offsetof(type,memb) ((Int)(HWord)&((type*)0)->memb) > #endif how about using __builtin_offsetof instead if its gcc? Dirk |