From 09779d94e50d37aab8bcba69fc7ed0e68371f4dc Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Tue, 27 Feb 2024 09:54:02 +0000 Subject: [PATCH] Fix error in format specifiers Use `PRIu64` for printing `uint64_t`s to prevent compiler warnings. --- c_emulator/riscv_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c_emulator/riscv_sim.c b/c_emulator/riscv_sim.c index f3c63435b..0094e9ad9 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);