This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] sim/sh: Fix compile warnings for 64-bit build hosts
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 15 Feb 2012 17:26:22 -0700
- Subject: [RFC] sim/sh: Fix compile warnings for 64-bit build hosts
Any comments on the following patch?
It fixes a bunch of warnings when building on a 64-bit host. Here
are a few of them:
./code.c:93: warning: cast from pointer to integer of different size
./code.c:215: warning: cast from pointer to integer of different size
./code.c:230: warning: cast from pointer to integer of different size
Kevin
* sh/interp.c (MA): Adjust cast to avoid warning on 64-bit hosts.
Index: interp.c
===================================================================
RCS file: /cvs/src/src/sim/sh/interp.c,v
retrieving revision 1.23
diff -u -p -r1.23 interp.c
--- interp.c 16 Apr 2011 18:16:36 -0000 1.23
+++ interp.c 16 Feb 2012 00:16:15 -0000
@@ -862,7 +862,7 @@ do { \
#else
#define MA(n) \
- do { memstalls += ((((int) PC & 3) != 0) ? (n) : ((n) - 1)); } while (0)
+ do { memstalls += ((((long) PC & 3) != 0) ? (n) : ((n) - 1)); } while (0)
#define L(x) thislock = x;
#define TL(x) if ((x) == prevlock) stalls++;