From 6ce663a8bdbc2481afd01bca55f334d42c7cb6be Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Thu, 3 Oct 2024 22:30:52 +0000 Subject: [PATCH] Fix -Wimplicit-function-declaration error with gcc 14. ``` malloc_info.c: In function 'leak_memory': malloc_info.c:12:12: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration] 12 | (void)!malloc(1024 * 1024 * 1024); | ^~~~~~ malloc_info.c:10:1: note: include '' or provide a declaration of 'malloc' 9 | #include "../util.h" +++ |+#include 10 | malloc_info.c:12:12: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch] 12 | (void)!malloc(1024 * 1024 * 1024); | ^~~~~~ ``` Taken from https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/72971/ Co-authored-by: @mio --- test/malloc_info.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/malloc_info.c b/test/malloc_info.c index 50b256f..3b99ead 100644 --- a/test/malloc_info.c +++ b/test/malloc_info.c @@ -1,5 +1,6 @@ #include #include +#include #if defined(__GLIBC__) || defined(__ANDROID__) #include