Skip to content

Commit 6ce663a

Browse files
jvoisinthestinger
authored andcommitted
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 '<stdlib.h>' or provide a declaration of 'malloc' 9 | #include "../util.h" +++ |+#include <stdlib.h> 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
1 parent 9ca9d2d commit 6ce663a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/malloc_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <pthread.h>
22
#include <stdio.h>
3+
#include <stdlib.h>
34

45
#if defined(__GLIBC__) || defined(__ANDROID__)
56
#include <malloc.h>

0 commit comments

Comments
 (0)