[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/8] Define a HAVE___STRCHRNUL macro properly

From: KO Myung-Hun
Subject: [PATCH 2/8] Define a HAVE___STRCHRNUL macro properly
Date: Sun, 20 Nov 2022 23:42:51 +0900

lib/fnmatch.c tests a HAVE___STRCHRNUL macro to implement an alternative

Without this, compilation fails on OS/2 kLIBC due to duplicated
declarations of __strchrnul() like this:

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 
  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);
      |          ^~~~~~~~~~~

* configure.ac: Check __strchrnul().
 configure.ac | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index 9f688971..17291d4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,9 @@ AC_FUNC_CLOSEDIR_VOID
 # dir.c and our glob.c use dirent.d_type if available
+# fnmatch.c uses __strchrnul()
 # See if the user wants to add (or not) GNU Guile support
 AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
             [Support GNU Guile for embedded scripting])])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]