[PATCH] Fix -Wundef warnings in fnmatch.c
Siddhesh Poyarekar
siddhesh@redhat.com
Thu Jul 31 19:49:00 GMT 2014
Fixes -Wundef warnings for MBSTATE_T and HAVE_STRING_H. The
HAVE_STRING_H bit is a merge from the gnulib fnmatch.c and the
MBSTATE_T fix has been posted to gnulib for inclusion.
Tested that the code is unchanged on i386.
Siddhesh
* posix/fnmatch.c: Include string.h unconditionally.
[defined _LIBC || WIDE_CHAR_SUPPORT]: Check if _LIBC is
defined before checking MBSTATE_T.
---
posix/fnmatch.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/posix/fnmatch.c b/posix/fnmatch.c
index ca95ab4..8b4d0dc 100644
--- a/posix/fnmatch.c
+++ b/posix/fnmatch.c
@@ -28,12 +28,7 @@
#include <errno.h>
#include <fnmatch.h>
#include <ctype.h>
-
-#if HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <string.h>
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
@@ -136,7 +131,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
# define ISWCTYPE(WC, WT) iswctype (WC, WT)
# endif
-# if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC
+# if defined _LIBC || (HAVE_MBSTATE_T && HAVE_MBSRTOWCS)
/* In this case we are implementing the multibyte character handling. */
# define HANDLE_MULTIBYTE 1
# endif
--
1.9.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20140731/008b2109/attachment.sig>
More information about the Libc-alpha
mailing list