From 90e123dd600140ccc0731668e1256e1a55b04f8f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 9 Jan 2021 14:06:15 -0500 Subject: [PATCH] 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. --- sim/common/ChangeLog | 4 ++++ sim/common/sim-core.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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. -- 2.30.2