aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Hutt <timothy.hutt@codasip.com>2024-02-27 09:54:02 +0000
committerBill McSpadden <bill@riscv.org>2024-03-24 20:02:08 -0500
commit4211935cfd1290c923b8243235faffdc76df0233 (patch)
tree2a0194b0857325948a7921caede358a9484cc62d
parentdf6eac371d270556012e46a0bb912e5dc51fad84 (diff)
downloadsail-riscv-4211935cfd1290c923b8243235faffdc76df0233.zip
sail-riscv-4211935cfd1290c923b8243235faffdc76df0233.tar.gz
sail-riscv-4211935cfd1290c923b8243235faffdc76df0233.tar.bz2
Fix error in format specifiers
Use `PRIu64` for printing `uint64_t`s to prevent compiler warnings.
-rw-r--r--c_emulator/riscv_sim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c_emulator/riscv_sim.c b/c_emulator/riscv_sim.c
index f3c6343..0094e9a 100644
--- a/c_emulator/riscv_sim.c
+++ b/c_emulator/riscv_sim.c
@@ -288,7 +288,7 @@ static int process_args(int argc, char **argv)
break;
case OPT_PMP_COUNT:
pmp_count = atol(optarg);
- fprintf(stderr, "PMP count: %lld\n", pmp_count);
+ fprintf(stderr, "PMP count: %" PRIu64 "\n", pmp_count);
if (pmp_count != 0 && pmp_count != 16 && pmp_count != 64) {
fprintf(stderr, "invalid PMP count: must be 0, 16 or 64");
exit(1);
@@ -297,7 +297,7 @@ static int process_args(int argc, char **argv)
break;
case OPT_PMP_GRAIN:
pmp_grain = atol(optarg);
- fprintf(stderr, "PMP grain: %lld\n", pmp_grain);
+ fprintf(stderr, "PMP grain: %" PRIu64 "\n", pmp_grain);
if (pmp_grain >= 64) {
fprintf(stderr, "invalid PMP grain: must less than 64");
exit(1);