Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christian Biesinger via Gdb-patches <gdb-patches@sourceware.org>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH/committed] sim: rx: cast bfd_vma when printing
Date: Mon, 3 May 2021 11:20:56 -0500	[thread overview]
Message-ID: <CAPTJ0XEPNKNZ-bknVsgvk5Jcrm6ScW11x117Akik6xa_Qr3zQA@mail.gmail.com> (raw)
In-Reply-To: <20210501202929.29766-1-vapier@gentoo.org>

On Sat, May 1, 2021, 15:29 Mike Frysinger via Gdb-patches <
gdb-patches@sourceware.org> wrote:

> A bit of a hack, but it's what we've been doing so far when printing
> bfd_vma's since bfd doesn't provide PRI helper types for us to use.
> ---
>  sim/rx/ChangeLog | 4 ++++
>  sim/rx/load.c    | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog
> index 7541c9d7141b..633ed86780c7 100644
> --- a/sim/rx/ChangeLog
> +++ b/sim/rx/ChangeLog
> @@ -1,3 +1,7 @@
> +2021-05-01  Mike Frysinger  <vapier@gentoo.org>
> +
> +       * load.c (rx_load): Cast size to long.
> +
>  2021-04-26  Mike Frysinger  <vapier@gentoo.org>
>
>         * Makefile.in (NL_TARGET): Delete.
> diff --git a/sim/rx/load.c b/sim/rx/load.c
> index a8a473346c67..b4523e12ac75 100644
> --- a/sim/rx/load.c
> +++ b/sim/rx/load.c
> @@ -151,7 +151,7 @@ rx_load (bfd *prog, host_callback *callback)
>         }
>        if (bfd_bread (buf, size, prog) != size)
>         {
> -         fprintf (stderr, "Failed to read %lx bytes\n", size);
> +         fprintf (stderr, "Failed to read %lx bytes\n", (long) size);
>

Wouldn't it be better to use "long long", especially for mingw?

Christian

          continue;
>         }
>
> --
> 2.31.1
>
>

  reply	other threads:[~2021-05-03 18:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01 20:29 Mike Frysinger via Gdb-patches
2021-05-03 16:20 ` Christian Biesinger via Gdb-patches [this message]
2021-05-03 20:57   ` Mike Frysinger via Gdb-patches
2021-05-03 21:47     ` Christian Biesinger via Gdb-patches
2021-05-04  0:47       ` Mike Frysinger via Gdb-patches
2021-05-04  2:54         ` Mike Frysinger via Gdb-patches
2021-05-04 12:17           ` [PATCH/committed] sim: clean up bfd_vma printing Mike Frysinger via Gdb-patches

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=CAPTJ0XEPNKNZ-bknVsgvk5Jcrm6ScW11x117Akik6xa_Qr3zQA@mail.gmail.com \
    --to=gdb-patches@sourceware.org \
    --cc=cbiesinger@google.com \
    --cc=vapier@gentoo.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