aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-04-11 11:00:39 +0200
committerThomas Weißschuh <linux@weissschuh.net>2025-04-22 10:56:24 +0200
commite5407c0820ea5fa7117b85ed32b724af73156d63 (patch)
treea5eca5118fe9aa2666030795fb74ab1f968d59a2
parenttools/nolibc: handle intmax_t/uintmax_t in printf (diff)
downloadwireguard-linux-e5407c0820ea5fa7117b85ed32b724af73156d63.tar.xz
wireguard-linux-e5407c0820ea5fa7117b85ed32b724af73156d63.zip
tools/nolibc: use intmax definitions from compiler
The printf format checking in the compiler uses the intmax types from the compiler, not libc. This can lead to compiler errors. Instead use the types already provided by the compiler. Example issue with clang 19 for arm64: nolibc-test.c:30:2: error: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uintmax_t' (aka 'unsigned long long') [-Werror,-Wformat] Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--tools/include/nolibc/stdint.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/include/nolibc/stdint.h b/tools/include/nolibc/stdint.h
index cd79ddd6170e..b052ad6303c3 100644
--- a/tools/include/nolibc/stdint.h
+++ b/tools/include/nolibc/stdint.h
@@ -39,8 +39,8 @@ typedef size_t uint_fast32_t;
typedef int64_t int_fast64_t;
typedef uint64_t uint_fast64_t;
-typedef int64_t intmax_t;
-typedef uint64_t uintmax_t;
+typedef __INTMAX_TYPE__ intmax_t;
+typedef __UINTMAX_TYPE__ uintmax_t;
/* limits of integral types */