From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Cc: Kevin Buettner <kevinb@redhat.com>
Subject: Re: [RFC] sim/sh: Fix compile warnings for 64-bit build hosts
Date: Fri, 17 Feb 2012 01:21:00 -0000 [thread overview]
Message-ID: <201202161851.38810.vapier@gentoo.org> (raw)
In-Reply-To: <20120216163116.34dae543@mesquite.lan>
[-- Attachment #1: Type: Text/Plain, Size: 1491 bytes --]
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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-02-16 23:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 4:46 Kevin Buettner
2012-02-16 4:54 ` Mike Frysinger
2012-02-16 23:36 ` Kevin Buettner
2012-02-17 1:21 ` Mike Frysinger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201202161851.38810.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox