[PATCH 2/3] glob: 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/glob.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/newlib/libc/posix/glob.c b/newlib/libc/posix/glob.c
index 20eec0263..7dc3cbbe1 100644
--- a/newlib/libc/posix/glob.c
+++ b/newlib/libc/posix/glob.c
@@ -620,7 +620,7 @@ glob3(pathbuf, pathend, pathend_last, pattern, restpattern, pglob, limit)
* and dirent.h as taking pointers to differently typed opaque
* structures.
*/
- struct dirent *(*readdirfunc)();
+ struct dirent *(*readdirfunc)(void *);
if (pathend > pathend_last)
return (1);
@@ -645,7 +645,7 @@ glob3(pathbuf, pathend, pathend_last, pattern, restpattern, pglob, limit)
if (pglob->gl_flags & GLOB_ALTDIRFUNC)
readdirfunc = pglob->gl_readdir;
else
- readdirfunc = readdir;
+ readdirfunc = (struct dirent *(*)(void *))readdir;
while ((dp = (*readdirfunc)(dirp))) {
u_char *sc;
Char *dc;
--
2.43.0