From patchwork Fri Jun 14 14:09:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 33116 Received: (qmail 74681 invoked by alias); 14 Jun 2019 14:09:45 -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 74673 invoked by uid 89); 14 Jun 2019 14:09:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=anticipate X-HELO: mx1.redhat.com From: Florian Weimer To: libc-alpha@sourceware.org Subject: Re: [PATCH] : Inhibit macro expansion for __glibc_has_include References: <87a7em6ben.fsf@oldenburg2.str.redhat.com> Date: Fri, 14 Jun 2019 16:09:41 +0200 In-Reply-To: <87a7em6ben.fsf@oldenburg2.str.redhat.com> (Florian Weimer's message of "Wed, 12 Jun 2019 18:01:04 +0200") Message-ID: <87tvcss1ga.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 * Florian Weimer: > This is currently ineffective with GCC because of GC PR 80005, but > it makes sense to anticipate a fix for this defect. > > Suggested by Zack Weinberg. > > 2019-06-12 Florian Weimer > > * misc/sys/cdefs.h (__glibc_has_include): Do not use a > function-like macro, so that __has_include can inhibit expansion > of its argument. > > diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h > index 638872b87b..ed146ce20b 100644 > --- a/misc/sys/cdefs.h > +++ b/misc/sys/cdefs.h > @@ -413,7 +413,7 @@ > #endif > > #ifdef __has_include > -# define __glibc_has_include(header) __has_include (header) > +# define __glibc_has_include __has_include > #else > # define __glibc_has_include(header) 0 > #endif This is what I plan to commit shortly. I don't want to mention the GCC PR in the public header because it will be outdated soon (I hope). Thanks, Florian : Inhibit macro expansion for __glibc_has_include This is currently ineffective with GCC because of GCC PR 80005, but it makes sense to anticipate a fix for this defect. Suggested by Zack Weinberg. 2019-06-14 Florian Weimer * misc/sys/cdefs.h (__glibc_has_include): Do not use a function-like macro, so that __has_include can inhibit expansion of its argument. Reviewed-by: Carlos O'Donell diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 638872b87b..f1bd994a10 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -413,7 +413,9 @@ #endif #ifdef __has_include -# define __glibc_has_include(header) __has_include (header) +/* Do not use a function-like macro, so that __has_include can inhibit + macro expansion. */ +# define __glibc_has_include __has_include #else # define __glibc_has_include(header) 0 #endif