]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Stop gcc-4.2 producing hundreds of complaints of the form "warning:
authorJulian Seward <jseward@acm.org>
Tue, 1 May 2007 13:53:01 +0000 (13:53 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 1 May 2007 13:53:01 +0000 (13:53 +0000)
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

VEX/pub/libvex_basictypes.h

index 76aa2439d4ddc2d871aa8c251b6b83d360d170af..31b30db775ee191112024d20086c709f9163f81d 100644 (file)
@@ -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