From 202a0bd12f877497eb73a42b22cf2562fb255963 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Thu, 3 Aug 2023 09:28:49 +0200 Subject: [PATCH] tools/nolibc: stdint: use __SIZE_TYPE__ for size_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise both gcc and clang may generate warnings about type mismatches: sysroot/mips/include/string.h:12:14: warning: mismatch in argument 1 type of built-in function 'malloc'; expected 'unsigned int' [-Wbuiltin-declaration-mismatch] 12 | static void *malloc(size_t len); | ^~~~~~ The compiler provides __SIZE_TYPE__ as the type that corresponds to size_t (typically "long unsigned int" or "unsigned int"). It was verified to be available at least since gcc-3.4 and clang-3.8, so from now on we'll use this definition for size_t. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/lkml/20230805161929.GA15284@1wt.eu/ Signed-off-by: Willy Tarreau --- tools/include/nolibc/stdint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/include/nolibc/stdint.h b/tools/include/nolibc/stdint.h index 4b28243..6665e27 100644 --- a/tools/include/nolibc/stdint.h +++ b/tools/include/nolibc/stdint.h @@ -15,7 +15,7 @@ typedef unsigned int uint32_t; typedef signed int int32_t; typedef unsigned long long uint64_t; typedef signed long long int64_t; -typedef unsigned long size_t; +typedef __SIZE_TYPE__ size_t; typedef signed long ssize_t; typedef unsigned long uintptr_t; typedef signed long intptr_t; -- 2.7.4