[PATCH 1/3] ftw: Fix incompatible pointer types error
Sebastian Huber
sebastian.huber@embedded-brains.de
Sat May 17 16:39:22 GMT 2025
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
More information about the Newlib
mailing list