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.
This commit is contained in:
Mike Frysinger 2021-01-09 14:06:15 -05:00
parent 933306703a
commit 90e123dd60
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2021-01-11 Mike Frysinger <vapier@gentoo.org>
* sim-core.c (sim_memory_map): Change %#x to PRIxTW.
2021-01-11 Mike Frysinger <vapier@gentoo.org>
* acinclude.m4 (SIM_AC_COMMON): Delete checks for stdlib.h, string.h,

View File

@ -480,7 +480,8 @@ sim_memory_map (SIM_DESC sd)
if (mapping->level != 0)
continue;
entry = xasprintf ("<memory type='ram' start='%#x' length='%#x'/>\n",
entry = xasprintf ("<memory type='ram' start='%#" PRIxTW "' "
"length='%#" PRIxTW "'/>\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.