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]

Re: [PATCH] Fix -Wundef warnings in fnmatch.c


On Thu, Jul 31, 2014 at 12:57:03PM -0700, Roland McGrath wrote:
> I'd tend toward putting more HAVE_* defines in libc-symbols.h rather than
> having gnulib-shared code test _LIBC.

OK, how about this?

Siddhesh

	* include/libc-symbols.h (HAVE_MBSTATE_T): Define macro.
	(HAVE_MBSRTOWCS): Likewise.
	* posix/fnmatch.c: Include string.h unconditionally.

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 03061ae..d833eb7 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -57,9 +57,11 @@
    so it's harmless.  */
 #define HAVE_CONFIG_H	0
 
-/* Define this for the benefit of portable GNU code that wants to check it.
-   Of course, it's never false when building libc!  */
+/* Define these macros for the benefit of portable GNU code that wants to check
+   them.  Of course, STDC_HEADERS is never false when building libc!  */
 #define STDC_HEADERS	1
+#define HAVE_MBSTATE_T	1
+#define HAVE_MBSRTOWCS	1
 
 /* The symbols in all the user (non-_) macros are C symbols.  */
 
diff --git a/posix/fnmatch.c b/posix/fnmatch.c
index ca95ab4..c330a12 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>

Attachment: pgpLp881BwcNa.pgp
Description: PGP signature


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