Skip to content

Commit

Permalink
Fix error in format specifiers
Browse files Browse the repository at this point in the history
Use `PRIu64` for printing `uint64_t`s to prevent compiler warnings.
  • Loading branch information
Timmmm committed Feb 27, 2024
1 parent 9602e3a commit 09779d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c_emulator/riscv_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 09779d9

Please sign in to comment.