This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix -Wundef warnings in fnmatch.c


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

Attachment: pgpsQsiDpD7JM.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]