From 9aad9b92bf1115884fa56700f43914aea03ee716 Mon Sep 17 00:00:00 2001 From: Brahmajit Das Date: Sun, 30 Jul 2023 00:29:44 +0530 Subject: [PATCH] Fix building with clang 16 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit From Clang 16 (and GCC 13) -Wimplicit-function-declaration has been turned on by default. This resutls in warnings such as song_hash.c: In function ‘insert_song’: song_hash.c:22:39: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration] 22 | new_elt = (struct hash_elt *) malloc(sizeof(struct hash_elt)); | ^~~~~~ This patch should fix these warnings. The warnings can be reproceded by both recent version of Clang and GCC. First discovered on Gentoo Linux: https://bugs.gentoo.org/882321 Signed-off-by: Brahmajit Das --- wmmp3/buttons.c | 1 + wmmp3/main.c | 1 + wmmp3/mpg123ctl.c | 2 ++ wmmp3/song_hash.c | 2 ++ 4 files changed, 6 insertions(+) diff --git a/wmmp3/buttons.c b/wmmp3/buttons.c index 98bfd10..dd9d944 100644 --- a/wmmp3/buttons.c +++ b/wmmp3/buttons.c @@ -10,6 +10,7 @@ * $Id: mpg123ctl.c,v 1.12 1999/10/08 06:21:41 pcrosby Exp $ */ +#include "wmgeneral.h" #include "buttons.h" struct coord { diff --git a/wmmp3/main.c b/wmmp3/main.c index ec3bdac..beca147 100644 --- a/wmmp3/main.c +++ b/wmmp3/main.c @@ -11,6 +11,7 @@ * $Id: main.c,v 1.11 1999/10/08 22:21:32 pcrosby Exp $ */ +#include #include "main.h" #define B_STOP 0 diff --git a/wmmp3/mpg123ctl.c b/wmmp3/mpg123ctl.c index 83cd5dc..a4b457b 100644 --- a/wmmp3/mpg123ctl.c +++ b/wmmp3/mpg123ctl.c @@ -14,6 +14,8 @@ * $Id: mpg123ctl.c,v 1.15 1999/10/12 04:41:20 pcrosby Exp $ */ +#include +#include #include "mpg123ctl.h" #define MAXDIRS 100 diff --git a/wmmp3/song_hash.c b/wmmp3/song_hash.c index fc46609..4284df5 100644 --- a/wmmp3/song_hash.c +++ b/wmmp3/song_hash.c @@ -1,3 +1,5 @@ +#include +#include #include "song_hash.h" #define HASH_TABLE_SIZE 11 -- 2.11.4.GIT