From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from AUS01-SY4-obe.outbound.protection.outlook.com (mail-sy4aus01olkn20822.outbound.protection.outlook.com [IPv6:2a01:111:f403:7005::822]) by sourceware.org (Postfix) with ESMTPS id E7EA23858D39 for ; Tue, 5 Oct 2021 04:51:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7EA23858D39 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PMW7COsyyiXCMMCc0cSR2xwlEzs8uHOUKdFp2XNcDx0CACKYkTgd1IH92PiXCaA18dj/e/otDJyVAGOjk8DMn3GIJZ4GR37KLnpQ5ltGnSiN6GTUrWS1EY2HqneBhe6FpHQSlLERBTdQN4DMD2qRX3gFQ3UYIuU4vq9rU5P0vmasJWhJG8p36REjZH3EKUQT9e9cJSnAfm4P22cB60UWY5C0D8xwmf70reaNYWOxpKNOX6JPSzAvcouK48fDMLr6mULrmJE4Ul+uD1b1Hi3Kw2pWnF47vzHzgYGwqUt1re8eTkMs6aBxN8u2zzjn/Wrq9kydF2g/mh2TiWlsNLA8Og== 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=ma+P3lwIsW11AfMPr3eOxNJzV1+vNBEhVaI+Gxx9OmM=; b=fA4B7X/LX8mNYHUnUo44ZicDmE522sychamF+f4jF2IvTSgM3J7MDcdS8x5r+zFpDWIyMwGA6R/jNO65jb+S7mloX7EJ+lfzsugM0fHPi9c29ODgyZc3uu9LkkjZgmgQufQdZtqvVY/gDdgZM61r8FOdF7EOiatri1i3d3V9a8wm01oP0DIX0emKL5qfE7noyEIdZRzUPISYHv3S3e1n2zFgj5q1Eh/nsCwDTCpWv49aAo5f5NLEmNEdOvf3N3hvfQAdqkz+r9wakqlttZtz9jV3DPvn6cYsTKcKrgiKEz9PoRXMUsv9CSca2J0KHBV5iRgtSAcUTJcLiCVCOyDIOw== 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 MEYP282MB2280.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:f8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Tue, 5 Oct 2021 04:51:34 +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; Tue, 5 Oct 2021 04:51:34 +0000 Subject: Re: [PATCH] gdb: Fix build error on macOS To: gdb-patches@sourceware.org, bug-gnulib@gnu.org References: From: Enze Li Message-ID: Date: Tue, 5 Oct 2021 12:51:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [xVxmkhPVzXn2OB5ZOOXYiC1mT9Q88at8] X-ClientProxiedBy: HK2PR02CA0135.apcprd02.prod.outlook.com (2603:1096:202:16::19) To MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:71::10) X-Microsoft-Original-Message-ID: <0439b3ff-ac0f-f85b-4a92-5f8a91567c22@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.3.105] (61.48.214.232) by HK2PR02CA0135.apcprd02.prod.outlook.com (2603:1096:202:16::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.16 via Frontend Transport; Tue, 5 Oct 2021 04:51:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80f2e2d1-be9c-4a21-86e2-08d987bbce5c X-MS-TrafficTypeDiagnostic: MEYP282MB2280: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ivGNltvI1u8OoDrtbbdKn88wQqeoSSwRUtTHfii7pnmUnNJHnyl72Jqcij8lIvd5MeWNtD2MI1p6m3VSgRGa29BawTAPRGdPlU/TaJXxu5IDJNy/N5SqVNVuWE9qlkWYrRFbPaqLAzm/CKhu43wI6Lx2V+KjaJzNod/Sr0D4nApStflB/HSNcDCZzNBv5oxVZfDVyexzdZjENrffqpmjqIvv+YLcY6f56NlFcK8iK3nngur4SO0e8XcV5tfwOATtqviOfx0slk7oFujjEU5H+PN/F3/wsmQOussRK60Fyp698IzFuwZF8R5Z1utqC7qcBVWtzzTlaWXxuiGVhbpVpl8nbyScVMj6jLkIXd+bhpe9fiKhA4FatFD4UNKoiF3oxDjc6cMHNbt9Ry93k5UKeuxyjr2I/TN4ZUB+UGlV25YTkqS6aMoNay/6c1oxMjyTe1kPfjSKU8JpdYqnAQpynAI3ORwP9q1lK8IMqEQqwDs= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rqUIDqqgoPeW+aCqAoVBsIPX0dV/139O/vthd/y/Eindk7lHxArN2LCMOUk44HQ+fMdxczx2sQzycUZ49mqJB1FoHwn4+EZ4hC6fscUWfNCZqIWR1V7q5+pElu23pAkWMz+p6x053I2oVULms+fvZw== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-8dac2.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 80f2e2d1-be9c-4a21-86e2-08d987bbce5c X-MS-Exchange-CrossTenant-AuthSource: MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2021 04:51:34.3618 (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: MEYP282MB2280 X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_MUA_MOZILLA, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, SPF_HELO_PASS, 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: 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: , X-List-Received-Date: Tue, 05 Oct 2021 04:51:44 -0000 [ add bug-gnulib@gnu.org ] On 10/4/21 6:03 PM, Enze Li via Gdb-patches wrote: > 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. " \ >