OS/2 kLIBC has __strchrnul(). But HAVE___STRCHRNUL is undefined. 'static' declarion of __strchrnul() causes an error with gcc4 because OS/2 kLIBC declares __strchrnul() as public.
----- gcc -DHAVE_CONFIG_H -I. -I../src -D__ST_MT_ERRNO__ -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -O2 -Zomf -Zmt -MT libgnu_a-fnmatch.o -MD -MP -MF .deps/libgnu_a-fnmatch.Tpo -c -o libgnu_a-fnmatch.o `test -f 'fnmatch.c' || echo './'`fnmatch.c fnmatch.c:135:1: error: static declaration of '__strchrnul' follows non-static declaration 135 | __strchrnul (s, c) | ^~~~~~~~~~~ In file included from fnmatch.c:34: f:/lang/gcc/usr/include/string.h:198:10: note: previous declaration of '__strchrnul' was here 198 | char *__strchrnul(const char *, int); | ^~~~~~~~~~~ ----- --- lib/fnmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fnmatch.c b/lib/fnmatch.c index 4da8c5f..decfe7a 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -130,7 +130,7 @@ extern int errno; /* This function doesn't exist on most systems. */ -# if !defined HAVE___STRCHRNUL && !defined _LIBC +# if !defined HAVE___STRCHRNUL && !defined _LIBC && !defined __KLIBC__ static char * __strchrnul (s, c) const char *s; -- 2.30.0