Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] sim/sh: Fix compile warnings for 64-bit build hosts
Date: Thu, 16 Feb 2012 23:36:00 -0000	[thread overview]
Message-ID: <20120216163116.34dae543@mesquite.lan> (raw)
In-Reply-To: <201202152350.35277.vapier@gentoo.org>

On Wed, 15 Feb 2012 23:50:34 -0500
Mike Frysinger <vapier@gentoo.org> 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.

Kevin


  reply	other threads:[~2012-02-16 23:31 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 [this message]
2012-02-17  1:21     ` Mike Frysinger

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=20120216163116.34dae543@mesquite.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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