Skip to content

Commit

Permalink
fe310: Fix debug format strings
Browse files Browse the repository at this point in the history
read_csr() returns an unsigned long, not a uint32_t. This causes a
-Wformat warning to be emitted when compiling with clang. This commit
fixes the warning by changing the format string.
  • Loading branch information
nmeum committed Oct 7, 2020
1 parent 07e9f4e commit 91707a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpu/fe310/irq_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ void handle_trap(uint32_t mcause)
#ifdef DEVELHELP
printf("Unhandled trap:\n");
printf(" mcause: 0x%"PRIx32"\n", mcause);
printf(" mepc: 0x%"PRIx32"\n", read_csr(mepc));
printf(" mtval: 0x%"PRIx32"\n", read_csr(mtval));
printf(" mepc: 0x%lx\n", read_csr(mepc));
printf(" mtval: 0x%lx\n", read_csr(mtval));
#endif
/* Unknown trap */
core_panic(PANIC_GENERAL_ERROR, "Unhandled trap");
Expand Down

0 comments on commit 91707a6

Please sign in to comment.