From patchwork Thu Jul 31 20:25:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 2262 Received: (qmail 22723 invoked by alias); 31 Jul 2014 20:25:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 22706 invoked by uid 89); 31 Jul 2014 20:25:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Fri, 1 Aug 2014 01:55:38 +0530 From: Siddhesh Poyarekar To: Roland McGrath Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Fix -Wundef warnings in fnmatch.c Message-ID: <20140731202538.GM16739@spoyarek.pnq.redhat.com> References: <20140731194853.GJ16739@spoyarek.pnq.redhat.com> <20140731195703.183A02C3A13@topped-with-meat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140731195703.183A02C3A13@topped-with-meat.com> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) 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 #include #include - -#if HAVE_STRING_H || defined _LIBC -# include -#else -# include -#endif +#include #if defined STDC_HEADERS || defined _LIBC # include