From: Jim Wilson <jimw@sifive.com>
To: gdb-patches@sourceware.org
Cc: Jim Wilson <jimw@sifive.com>
Subject: [PATCH 1/2] RISC-V: Fix two ARI warnings.
Date: Thu, 10 Oct 2019 23:55:00 -0000 [thread overview]
Message-ID: <20191010235455.27036-1-jimw@sifive.com> (raw)
In-Reply-To: <CAFyWVaYZZ4PNygCCbXfKPDZMAvKgZYTn+yqzJkXRYbH3z_tVQg@mail.gmail.com>
> gdb/riscv-tdep.c:1657: code: %ll: Do not use printf(%ll), instead use printf(%s,phex()) to dump a 'long long' value
gdb/riscv-tdep.c:1657: "Writing %lld-byte nop instruction to %s: %s\n",
> gdb/riscv-tdep.c:1658: code: long long: Do not use 'long long', instead use LONGEST
gdb/riscv-tdep.c:1658: ((unsigned long long) sizeof (nop_insn)),
fprintf_unfiltered doesn't support z (or j for that matter), and fixing that
is a larger patch than I'd like to write, so this does basically what the
ARI warnings recommends. We don't need the cast as there is a prototype for
plongest.
* riscv-tdep.c (riscv_push_dummy_code): Change %lld to %s and use
plongest instead of unsigned long long cast.
---
gdb/riscv-tdep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index e4a66f1429..003b230fcf 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -1654,8 +1654,8 @@ riscv_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
if (riscv_debug_breakpoints || riscv_debug_infcall)
fprintf_unfiltered (gdb_stdlog,
- "Writing %lld-byte nop instruction to %s: %s\n",
- ((unsigned long long) sizeof (nop_insn)),
+ "Writing %s-byte nop instruction to %s: %s\n",
+ plongest (sizeof (nop_insn)),
paddress (gdbarch, *bp_addr),
(status == 0 ? "success" : "failed"));
--
2.17.1
next prev parent reply other threads:[~2019-10-10 23:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 23:54 [PATCH 0/2] fix ARI warnings for RISC-V port and fallout Jim Wilson
2019-10-10 23:55 ` Jim Wilson [this message]
2019-10-10 23:55 ` [PATCH 2/2] Improve comments in print-utils.h Jim Wilson
2019-10-11 13:15 ` [PATCH 0/2] fix ARI warnings for RISC-V port and fallout Tom Tromey
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=20191010235455.27036-1-jimw@sifive.com \
--to=jimw@sifive.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