From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71558 invoked by alias); 22 Nov 2019 12:32:30 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 71548 invoked by uid 89); 22 Nov 2019 12:32:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-18.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.1 spammy=unwanted X-Spam-Status: No, score=-18.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Nov 2019 12:32:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574425947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ClsbJmKCyv0GwYsV+AEL9BQkavEPgeYTLlknSdK1Mc=; b=bgqRwXUdl2agv3g6Uy+xGPanHIFQxArCUdV5VUqiq1+cRZWUrQtoYmXZMMAbKR2/4wLdoq S8taQZ3YUNBRzvREmHB15zhNJiowbzaTeYeXNhrKIyDDEJ3b4O+iMksYTe99JTipms5+Jx QkD745Y4JVPgGfXFMJ5NbubkzKgQFZg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-6-OZIOWUPWqABcOd5IgBsg-1; Fri, 22 Nov 2019 07:32:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7AED31005512 for ; Fri, 22 Nov 2019 12:32:24 +0000 (UTC) Received: from oldenburg2.str.redhat.com (dhcp-192-200.str.redhat.com [10.33.192.200]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E48063772 for ; Fri, 22 Nov 2019 12:32:24 +0000 (UTC) Received: by oldenburg2.str.redhat.com (Postfix, from userid 1000) id DD0B383BF6F6; Fri, 22 Nov 2019 13:32:22 +0100 (CET) Date: Tue, 01 Jan 2019 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.30 COMMITTED] Don't use a custom wrapper macro around __has_include (bug 25189). User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20191122123222.DD0B383BF6F6@oldenburg2.str.redhat.com> From: Florian Weimer X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 6-OZIOWUPWqABcOd5IgBsg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00022.txt.bz2 From: Emilio Cobos =C1lvarez This causes issues when using clang with -frewrite-includes to e.g., submit the translation unit to a distributed compiler. In my case, I was building Firefox using sccache. See [1] for a reduced test-case since I initially thought this was a clang bug, and [2] for more context. Apparently doing this is invalid C++ per [cpp.cond], which mentions [3]: > The #ifdef and #ifndef directives, and the defined conditional > inclusion operator, shall treat __has_include and __has_cpp_attribute > as if they were the names of defined macros. The identifiers > __has_include and __has_cpp_attribute shall not appear in any context > not mentioned in this subclause. [1]: https://bugs.llvm.org/show_bug.cgi?id=3D43982 [2]: https://bugs.llvm.org/show_bug.cgi?id=3D37990 [3]: http://eel.is/c++draft/cpp.cond#7.sentence-2 Change-Id: Id4b8ee19176a9e4624b533087ba870c418f27e60 (cherry picked from commit bfa864e1645e140da2e1aae3cf0d0ba0674f6eb5) diff --git a/NEWS b/NEWS index 5f1ade1c49..c7dcb54bb2 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ The following bugs are resolved with this release: [24867] malloc: Remove unwanted leading whitespace in malloc_info [24986] alpha: new getegid, geteuid and getppid syscalls used unconditionally + [25189] Don't use a custom wrapper macro around __has_include =20 =0C Version 2.30 diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index f1bd994a10..b1695376dc 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -412,14 +412,6 @@ # define __glibc_has_attribute(attr) 0 #endif =20 -#ifdef __has_include -/* 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 - #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ && !__GNUC_PREREQ (4,7)) diff --git a/sysdeps/unix/sysv/linux/bits/statx.h b/sysdeps/unix/sysv/linux= /bits/statx.h index 206878723f..aaccfdc2dc 100644 --- a/sysdeps/unix/sysv/linux/bits/statx.h +++ b/sysdeps/unix/sysv/linux/bits/statx.h @@ -26,11 +26,13 @@ =20 /* Use "" to work around incorrect macro expansion of the __has_include argument (GCC PR 80005). */ -#if __glibc_has_include ("linux/stat.h") -# include "linux/stat.h" -# ifdef STATX_TYPE -# define __statx_timestamp_defined 1 -# define __statx_defined 1 +#ifdef __has_include +# if __has_include ("linux/stat.h") +# include "linux/stat.h" +# ifdef STATX_TYPE +# define __statx_timestamp_defined 1 +# define __statx_defined 1 +# endif # endif #endif =20