This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] sim/sh: Fix compile warnings for 64-bit build hosts


On Thursday 16 February 2012 18:31:16 Kevin Buettner wrote:
> On Wed, 15 Feb 2012 23:50:34 -0500 Mike Frysinger wrote:
> > On Wednesday 15 February 2012 19:26:22 Kevin Buettner wrote:
> > > Any comments on the following patch?
> > 
> > uintptr_t i think would be better, but we don't seem to use that in sim/,
> > so this is OK
> > 
> > > 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
> > 
> > makes me think that this sim is incorrectly mixing target and host types
> 
> My reading of the code shows that (the variable behind) PC is char *.
> (PC is a macro defined to be insn_ptr.) The MA macro needs to convert
> that pointer to an int type in order to apply the mask.  So I agree
> that uintptr_t would be the right thing to use.
> 
> I've committed my patch, but if you wish I can try it with uintptr_t.
> This will require us to include stdint.h.

i don't think fixing this tiny issue would measurably improve the code, so 
don't worry about it.  to truly make the code better, the PC would need to not 
be a pointer but rather uint32_t (for 32bit SuperH procs) and uin64_t (for 
64bit SuperH procs).  and i imagine that is way more work than you want to 
take on ;).
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]