From: Mike Frysinger Date: Sat, 9 Jan 2021 19:06:15 +0000 (-0500) Subject: sim: common: fix printf formats X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90e123dd600140ccc0731668e1256e1a55b04f8f;p=binutils-gdb.git sim: common: fix printf formats For 32-bit targets, %x happens to work for unsigned_word. But for 64-bit targets, it's too small, and gcc throws an error. Use the right printf format define for them. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 6ffee1610d7..8039a78e327 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2021-01-11 Mike Frysinger + + * sim-core.c (sim_memory_map): Change %#x to PRIxTW. + 2021-01-11 Mike Frysinger * acinclude.m4 (SIM_AC_COMMON): Delete checks for stdlib.h, string.h, diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c index ade345ef16f..9b1e1683210 100644 --- a/sim/common/sim-core.c +++ b/sim/common/sim-core.c @@ -480,7 +480,8 @@ sim_memory_map (SIM_DESC sd) if (mapping->level != 0) continue; - entry = xasprintf ("\n", + entry = xasprintf ("\n", mapping->base, mapping->nr_bytes); /* The sim memory map is organized by access, not by addresses. So a RWX memory map will have three independent mappings.