From: Julian Seward Date: Tue, 1 May 2007 13:53:01 +0000 (+0000) Subject: Stop gcc-4.2 producing hundreds of complaints of the form "warning: X-Git-Tag: svn/VALGRIND_3_3_1^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be77bb4a0610d7031615003eff05b03cb7851e79;p=thirdparty%2Fvalgrind.git 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. git-svn-id: svn://svn.valgrind.org/vex/trunk@1759 --- diff --git a/VEX/pub/libvex_basictypes.h b/VEX/pub/libvex_basictypes.h index 76aa2439d4..31b30db775 100644 --- a/VEX/pub/libvex_basictypes.h +++ b/VEX/pub/libvex_basictypes.h @@ -123,7 +123,7 @@ typedef unsigned long HWord; /* 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