From f57c0872bf0b3e23c4963ba7a47704c50baeb229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Rodr=C3=ADguez?= Date: Tue, 10 Feb 2026 18:46:19 +0100 Subject: [PATCH] Fix signature of scandir filter callback for Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to POSIX 2008, the scandir filter callback takes a const dirent pointer. The existing code used the const-qualified signature for Linux only, but Darwin requires it too. This caused a warning (-Wincompatible-function-pointer-types) which recent versions of clang treat as a hard error: error: incompatible function pointer types passing 'int (*)(struct dirent *)' to parameter of type 'int (*)(const struct dirent *)' Fix by using the correct POSIX signature on Darwin as well. The non-const fallback is kept for older non-conforming systems. Signed-off-by: Guillermo Rodríguez --- src/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class.c b/src/class.c index af81530..210f999 100644 --- a/src/class.c +++ b/src/class.c @@ -2190,7 +2190,7 @@ char *getClassPath() { return classpath; } -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) int filter(const struct dirent *entry) { #else int filter(struct dirent *entry) {