public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/6] sim: mips: fix format warnings when setting up memory
Date: Tue, 15 Jun 2021 01:11:36 -0400	[thread overview]
Message-ID: <20210615051141.4801-1-vapier@gentoo.org> (raw)

The majority of these inputs are not long's, so don't use %lx.
This fixes compiler warnings about type mismatches.
---
 sim/mips/interp.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index 93bbc5c846c0..bccc4c76ed8b 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -436,7 +436,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
 	  if (mem_size > K1SIZE)
 	    mem_size = K1SIZE;
 	  /* memory alias K1BASE@1,K1SIZE%MEMSIZE,K0BASE */
-	  sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx%%0x%lx,0x%0x",
+	  sim_do_commandf (sd, "memory alias 0x%x@1,0x%x%%0x%lx,0x%0x",
 			   K1BASE, K1SIZE, (long)mem_size, K0BASE);
 	  if (WITH_TARGET_WORD_BITSIZE == 64)
 	    sim_do_commandf (sd, "memory alias 0x%x,0x%" PRIxTW ",0x%" PRIxTA,
@@ -453,13 +453,13 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
       STATE_ENVIRONMENT (sd) = OPERATING_ENVIRONMENT;
 
       /* ROM: 0x9FC0_0000 - 0x9FFF_FFFF and 0xBFC0_0000 - 0xBFFF_FFFF */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x,0x%0x",
 		       0x9FC00000, 
 		       4 * 1024 * 1024, /* 4 MB */
 		       0xBFC00000);
 
       /* SRAM: 0x8000_0000 - 0x803F_FFFF and 0xA000_0000 - 0xA03F_FFFF */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x,0x%0x",
 		       0x80000000, 
 		       4 * 1024 * 1024, /* 4 MB */
 		       0xA0000000);
@@ -468,7 +468,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
       for (i=0; i<8; i++) /* 32 MB total */
 	{
 	  unsigned size = 4 * 1024 * 1024;  /* 4 MB */
-	  sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+	  sim_do_commandf (sd, "memory alias 0x%x@1,0x%x,0x%0x",
 			   0x88000000 + (i * size), 
 			   size, 
 			   0xA8000000 + (i * size));
@@ -499,13 +499,13 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
       /* --- memory --- */
 
       /* ROM: 0x9FC0_0000 - 0x9FFF_FFFF and 0xBFC0_0000 - 0xBFFF_FFFF */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x,0x%0x",
 		       0x9FC00000, 
 		       4 * 1024 * 1024, /* 4 MB */
 		       0xBFC00000);
 
       /* SRAM: 0x8000_0000 - 0x803F_FFFF and 0xA000_0000 - 0xA03F_FFFF */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x,0x%0x",
 		       0x80000000, 
 		       4 * 1024 * 1024, /* 4 MB */
 		       0xA0000000);
@@ -514,7 +514,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
       for (i=0; i<8; i++) /* 32 MB total */
 	{
 	  unsigned size = 4 * 1024 * 1024;  /* 4 MB */
-	  sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx,0x%0x",
+	  sim_do_commandf (sd, "memory alias 0x%x@1,0x%x,0x%0x",
 			   0x88000000 + (i * size), 
 			   size, 
 			   0xA8000000 + (i * size));
@@ -522,15 +522,15 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
 
       /* Dummy memory regions for unsimulated devices - sorted by address */
 
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xB1000000, 0x400); /* ISA I/O */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xB2100000, 0x004); /* ISA ctl */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xB2500000, 0x004); /* LED/switch */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xB2700000, 0x004); /* RTC */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xB3C00000, 0x004); /* RTC */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xFFFF8000, 0x900); /* DRAMC */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xFFFF9000, 0x200); /* EBIF */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xFFFFE000, 0x01c); /* EBIF */
-      sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx", 0xFFFFF500, 0x300); /* PIO */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xB1000000, 0x400); /* ISA I/O */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xB2100000, 0x004); /* ISA ctl */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xB2500000, 0x004); /* LED/switch */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xB2700000, 0x004); /* RTC */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xB3C00000, 0x004); /* RTC */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xFFFF8000, 0x900); /* DRAMC */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xFFFF9000, 0x200); /* EBIF */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xFFFFE000, 0x01c); /* EBIF */
+      sim_do_commandf (sd, "memory alias 0x%x@1,0x%x", 0xFFFFF500, 0x300); /* PIO */
 
 
       /* --- simulated devices --- */
@@ -711,7 +711,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
 			 idt_monitor_base, idt_monitor_size,
 			 EXTENDED (idt_monitor_base));
       else
-	sim_do_commandf (sd, "memory region 0x%x,0x%x",
+	sim_do_commandf (sd, "memory region 0x%x,0x%" PRIxTA,
 			 idt_monitor_base, idt_monitor_size);
 
       /* Entry into the IDT monitor is via fixed address vectors, and
-- 
2.31.1


             reply	other threads:[~2021-06-15  5:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15  5:11 Mike Frysinger [this message]
2021-06-15  5:11 ` [PATCH 2/6] sim: mips: add casts to fpu conversions Mike Frysinger
2021-06-15  5:11 ` [PATCH 3/6] sim: mips: fix uninitialized register use Mike Frysinger
2021-06-15  5:11 ` [PATCH 4/6] sim: mips: tweak buffer sign Mike Frysinger
2021-06-15  5:11 ` [PATCH 5/6] sim: mips: rework dynamic printf logic to avoid compiler warnings Mike Frysinger
2021-06-15  5:11 ` [PATCH 6/6] sim: mips: add printf attribute to trace func 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=20210615051141.4801-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).