From 42451ed4718af3f93770feb201bd023625d69b3a Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 21 Apr 2022 23:25:57 +0300 Subject: fix warnings on 32bit riscv + Will most probably not work on 32bit, but nice to make 'portable' code. --- lib/fdt_dbg.c | 4 ++-- lib/ubsan.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/fdt_dbg.c b/lib/fdt_dbg.c index 296a8de..bf8e2d9 100644 --- a/lib/fdt_dbg.c +++ b/lib/fdt_dbg.c @@ -76,7 +76,7 @@ static void __print_prop_value(const void *data, int len) const int32_t *p = (const int32_t *)data; dbg("<"); for (int i = 0; i < len / 4; ++i) - dbg("%#08x%s", fdt32_to_cpu(p[i]), + dbg("%#08x%s", (unsigned int)fdt32_to_cpu(p[i]), i < (len / 4 - 1) ? " " : ""); dbg(">"); @@ -84,7 +84,7 @@ static void __print_prop_value(const void *data, int len) const int32_t *p = (const int32_t *)data; dbg("["); for (int i = 0; i < len / 4; ++i) - dbg("%#02x%s", fdt32_to_cpu(p[i]), + dbg("%#02x%s", (unsigned int)fdt32_to_cpu(p[i]), i < (len / 4 - 1) ? " " : ""); dbg("]"); diff --git a/lib/ubsan.c b/lib/ubsan.c index 906ba46..7f4df2a 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -71,8 +71,8 @@ struct tu_invalid_builtin_data { static void tu_print_location(const char *message, struct tu_source_location loc) { - bug("ubsan: %s at file %s, line %d, column %d\n", message, loc.file, - loc.line, loc.column); + bug("ubsan: %s at file %s, line %ju, column %ju\n", message, loc.file, + (uintmax_t)loc.line, (uintmax_t)loc.column); } void __ubsan_handle_add_overflow(struct tu_overflow_data *data) -- cgit v1.3