From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id 927F1385840E for ; Tue, 23 Nov 2021 15:26:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 927F1385840E Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AN9wHpC018549 for ; Tue, 23 Nov 2021 16:26:21 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3cgrusv1d8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 23 Nov 2021 16:26:20 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 83265100034 for ; Tue, 23 Nov 2021 16:26:20 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6448F228B7E for ; Tue, 23 Nov 2021 16:26:20 +0100 (CET) Received: from [10.131.138.188] (10.75.127.49) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Tue, 23 Nov 2021 16:26:20 +0100 Message-ID: <90c086c1-48f2-7df5-f5af-3bcd7e062b32@foss.st.com> Date: Tue, 23 Nov 2021 16:26:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH] libcpp: Use [[likely]] conditionally Content-Language: en-US To: References: <20211122172235.19438-1-polacek@redhat.com> <01c229cd-8ce8-8057-c3b2-98260ee31ae4@gmail.com> From: Christophe LYON In-Reply-To: <01c229cd-8ce8-8057-c3b2-98260ee31ae4@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-23_05,2021-11-23_01,2020-04-07_01 X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2021 15:26:25 -0000 Hi! On 23/11/2021 01:26, Jeff Law via Gcc-patches wrote: > > > On 11/22/2021 10:22 AM, Marek Polacek via Gcc-patches wrote: >> Let's hide [[likely]] behind a macro, to suppress warnings if the >> compiler doesn't support it. >> >> Co-authored-by: Jonathan Wakely >> >> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? >> >>     PR preprocessor/103355 >> >> libcpp/ChangeLog: >> >>     * lex.c: Use ATTR_LIKELY instead of [[likely]]. >>     * system.h (ATTR_LIKELY): Define. > OK > jeff This patch breaks the build when the host compiler is gcc-4.8.5, because __has_cpp_attribute is not defined. Is this small patch OK with a proper ChangeLog? diff --git a/libcpp/system.h b/libcpp/system.h index f6fc583ab80..b78ab813d2f 100644 --- a/libcpp/system.h +++ b/libcpp/system.h @@ -430,6 +430,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;  # else  #  define ATTR_LIKELY  # endif +#else +# define ATTR_LIKELY  #endif  /* Poison identifiers we do not want to use.  */ Thanks, Christophe