[1/2] RISC-V: Fix two ARI warnings.

Message ID 20191010235455.27036-1-jimw@sifive.com
State New, archived
Headers

Commit Message

Jim Wilson Oct. 10, 2019, 11:54 p.m. UTC
  > 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(-)
  

Patch

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"));