From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IAppDJ/RWmHaagAAWB0awg (envelope-from ) for ; Mon, 04 Oct 2021 06:04:15 -0400 Received: by simark.ca (Postfix, from userid 112) id 222731EE1A; Mon, 4 Oct 2021 06:04:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_REPLYTO_END_DIGIT,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 265D81E4A3 for ; Mon, 4 Oct 2021 06:04:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 73F833857425 for ; Mon, 4 Oct 2021 10:04:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73F833857425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633341853; bh=jo9S2DkumDht/scraoJBrI/3+IOu/xhPj4xlCHD4VvY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cKaGvOvGkKipbAsu8bGjLB5lO0DOIkA0T7NQC9tsmr7NboqW3Tdp+oXrDa9HS2WVe I4RcZrWxs1CG+QMUQUeCFxkqIUi810vpe9ogllZX0zYvlb56cwPyT/C9FU09nAnxKH eowq9eQyKvGnEPU4rlyK5n1StYiW7F4jJZcBSGF4= Received: from AUS01-SY4-obe.outbound.protection.outlook.com (mail-sy4aus01olkn2175.outbound.protection.outlook.com [40.92.62.175]) by sourceware.org (Postfix) with ESMTPS id 22AA53858408 for ; Mon, 4 Oct 2021 10:03:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22AA53858408 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q8ah9n9O+zyja6gXJzPMQMn+cyeSol0oYgwuvEo8yIoivBCOA1HNlV2G/IhcAhvDTc439sPjLgm7ct1eZTGEy7POzFnlU2sIO2FhneuATjegAsfpVp0NrxbmcLC5sRctHX7O9gnoVITGjQZf9BF8GauGqSTrJ7qhUK3oiAvnv/1kCrkrskxLogE9lVu753qfVJ4aqBoKlNkF/QlWlEucDpxlmASBScSPrGFVgQdYJrtOi8TjoNNee5Vos+9/T9aqkHB/iwXvOrBM5Widlq6Y/AtT5TxzamMb3jHv9tJK6LjzxZv3NB+NLWNnIGfYtQyxrk4KzBYPbfL773fo1BTExw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jo9S2DkumDht/scraoJBrI/3+IOu/xhPj4xlCHD4VvY=; b=GYIfcl0SV1KqFEjiDsimPcL6JAvi46G8ib5KEMXdGF3J5ACw+phL2AoR5hGCmg0vA2kGs/SdYBp8I8PFSY2RzUYyUrXA7FfckFiuwfhccAAzgKIl2wRQXZ2tFdoQzpz1Co+ZXAlHx6yQFKAFdCg7tPBLsLWGR2Io0OGmyCzfZ5vG2IHQg9hwv5jT50zfDchcYFfHtzO70tDe4lb3StDsFCwryVihECC3MFoxR6yUG/c+/OXEArVVNH6H9Sr7Pkg+fMPdhf+MjYcbBU+f0cftXBsLJYg79Pbz8v3XzHZ81ISxMshMW/U5lUVM5ooBc5spA1EIx4zYVrOYZgZlZqkSvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:71::10) by ME4P282MB0949.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:9a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Mon, 4 Oct 2021 10:03:51 +0000 Received: from MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM ([fe80::b1d5:bf09:16b0:4b2c]) by MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM ([fe80::b1d5:bf09:16b0:4b2c%7]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 10:03:51 +0000 To: gdb-patches@sourceware.org Subject: [PATCH] gdb: Fix build error on macOS Date: Mon, 4 Oct 2021 18:03:16 +0800 Message-ID: X-Mailer: git-send-email 2.30.2 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [CM44+hsrqWrZZGMAmyu0AGbRHw1GqLwm] X-ClientProxiedBy: HK2P15301CA0016.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::26) To MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:71::10) X-Microsoft-Original-Message-ID: <20211004100316.80588-1-lienze2010@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from asus.workspace (61.48.214.232) by HK2P15301CA0016.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.1 via Frontend Transport; Mon, 4 Oct 2021 10:03:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 848bee71-419c-431c-bd9c-08d9871e4407 X-MS-TrafficTypeDiagnostic: ME4P282MB0949: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YyC62gaYcS0/PaTVbZvlZjE4mm0tXygSFkUxDhwXJd2Vz85h+hdlFdWqam4dMBOzq8OVFSuulJug/miGxIcZTr10loqizSCoA4RInElHFr+H1Gjilv8RuA5CNYKx15GANW6O7z2RjRQImQ++ZVvJCVFoCMVNV/exopYj2HlvkcEHffcI6XORo70hfx/6qYsZxPrYG7/nNUBdRVntGwI/BTuDNn2JMWkb/s865nzvoiJlFXlSlSdQVHC564+eyY7W47YnaObDSYmI/z8lWV8/Ob89TPt2H6R2OjpBnT0tfcenBPGLY2iKGwub66qotCovlT8s1HZvUSoghdHyYckBbCqTPVKOgkb6woNp7yRp/QitpUtZ2L+6dkwkBPj7FxBSGOYxf54oxqCVUDMSa5lIB31EE85yT0kVDMSpx7uUVqt7JqhQz9JlerxWQxu8EdiCb8bYdHqbhkRA2hhq8aMJGhxFO8SgzthFSn6Kna7297k= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: j/AkMms61SYNAkvEw6yN8pTIC/tl2Gs+nLkMmuq2u60dMXax14EQDBqhucGACQi8pTCgaBN9VxnGKQY4XUqMhmkqhJ+PLwKNqNETgZxAeytHraU88p/znZCZGrnoRx33KYVGw9TvWrUquKQL0RU8Nw== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-8dac2.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 848bee71-419c-431c-bd9c-08d9871e4407 X-MS-Exchange-CrossTenant-AuthSource: MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 10:03:51.1671 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: ME4P282MB0949 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Enze Li via Gdb-patches Reply-To: Enze Li Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" PR build/28413 notes that the gdb master fails to build on macOS. Based on De Morgan's law, the expression !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) is equal to (!defined __GNUC__ || defined __clang__ || !__OPTIMIZE). The expression above looks weird, maybe there are some problems with this way of judging. When any one of the conditions is established, the subsequent judgment will be ignored. This patch works around the issue by rewriting the expression of judgment after referring to the nearby notes. Tested by building on x86_64-Linux and macOS(Mojave & Catalina). Bug: https://sourceware.org/PR28413 --- gnulib/import/c++defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnulib/import/c++defs.h b/gnulib/import/c++defs.h index 39df1bc76bc..dbbae2f1fa2 100644 --- a/gnulib/import/c++defs.h +++ b/gnulib/import/c++defs.h @@ -286,7 +286,7 @@ _GL_CXXALIASWARN_2 (func, namespace) /* To work around GCC bug , we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) +# if defined __GNUC__ && !defined __clang__ && !__OPTIMIZE__ # define _GL_CXXALIASWARN_2(func,namespace) \ _GL_WARN_ON_USE (func, \ "The symbol ::" #func " refers to the system function. " \ @@ -314,7 +314,7 @@ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) /* To work around GCC bug , we enable the warning only when not optimizing. */ -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) +# if defined __GNUC__ && !defined __clang__ && !__OPTIMIZE__ # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ "The symbol ::" #func " refers to the system function. " \ -- 2.30.2