[PATCH 1/3] ftw: Fix incompatible pointer types error

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
This fixes a compile error with GCC 15.
---
 newlib/libc/posix/ftw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/posix/ftw.c b/newlib/libc/posix/ftw.c
index 79e63582c..e3ca85cc5 100644
--- a/newlib/libc/posix/ftw.c
+++ b/newlib/libc/posix/ftw.c
@@ -30,7 +30,9 @@ int ftw(const char *path, int (*fn)(const char *, const struct stat *, int), int
 	/* The following cast assumes that calling a function with one
 	 * argument more than it needs behaves as expected. This is
 	 * actually undefined, but works on all real-world machines. */
-	return nftw(path, (int (*)())fn, fd_limit, FTW_PHYS);
+	return nftw(path,
+	    (int (*)(const char *, const struct stat *, int,  struct FTW *))fn,
+	    fd_limit, FTW_PHYS);
 }
 
 #endif /* ! HAVE_OPENDIR */
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.