[libc][assert] add __PRINTFLIKE to assert_fail_msg()

Fix a warning as a result of this.

fixes issue #302
This commit is contained in:
Travis Geiselbrecht
2021-11-12 22:07:14 -08:00
parent c9eae714db
commit 2bb32fe813
2 changed files with 2 additions and 2 deletions

View File

@@ -113,7 +113,7 @@ void riscv_set_satp(uint asid, paddr_t pt) {
#endif
// make sure the asid is in range
DEBUG_ASSERT_MSG((asid & riscv_asid_mask) == asid, "asid %#x mask %#x\n", asid, riscv_asid_mask);
DEBUG_ASSERT_MSG((asid & riscv_asid_mask) == asid, "asid %#x mask %#lx\n", asid, riscv_asid_mask);
satp |= (ulong)asid << RISCV_SATP_ASID_SHIFT;
// make sure the page table is aligned

View File

@@ -88,6 +88,6 @@ __BEGIN_CDECLS
// The following functions are called when an assert fails.
void assert_fail(const char *file, int line, const char *expression) __NO_RETURN __NO_INLINE;
void assert_fail_msg(const char *file, int line, const char *expression, const char *fmt,
...) __NO_RETURN __NO_INLINE;
...) __PRINTFLIKE(4, 5) __NO_RETURN __NO_INLINE;
__END_CDECLS