From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from AUS01-ME3-obe.outbound.protection.outlook.com (mail-me3aus01olkn2158.outbound.protection.outlook.com [40.92.63.158]) by sourceware.org (Postfix) with ESMTPS id A9EA83858D39 for ; Tue, 5 Oct 2021 09:11:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A9EA83858D39 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vuz7W5k8OCkPM5r8gZ8jPLNn84v/pWbAeHL2HoNHekneJuqfEG9miOmgr7LeGocxQJVd5cQRHgS+QGgY2MScf5hXL6+6qdyeVWIo4jgD/O/ZS2ecQDz99q4/pOLuqXBczClJhkIYsr3eOgH0xlf3G2C+aeOwyH73jj/FbWaCm/kJ8ITnNb6azpF/1DnPORKIDqJ2Dp0tWlvVvJnZ6N8TOQuQ42+UnFuuWJAQ49YAPoe9OxkDyyh8etnFNFl2azl0I1QbvcmgXZlE9nlBZhhhjss8HJ5SukuAn++38AQTwz74GTCGnK1P9gSW/b1AVMFXyRoEfkAWjmopdKVZCKCRIg== 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=a+wTIWaepeegx5BQBexQapvWU4+6oKZmLTYDUcQJlZ0=; b=FzcSI4TU7OTsQuHZgcINQDvt2aA8ZfQuEv6DNmtMmdZzJbOE+cfxtZjNRSrvYVTnDsCk95JVHtP51pKI04f5dAh8zTaB4Mr6+vc25GFTDMg96U/yrZerRhaIvAxV8SRBtcxqB8KU45zn10GWbE++X62lP2/0UQ4z96oE6aBk4N4qoBYUdrVYleWSBrL+bznYWcz3/aiD6S0BN+JFfACEQbwqLoo+62xpazkm+QP6h43Gm6X0rTLq59YO9GGdgms/NrbkVSfy2hyQBXi67U/DXVJs0IHzRNx10vlLziKfBZJMowWvNzlEt56gEtDY3dSoYoD1AFEH4OjAElbXyD9low== 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 ME3P282MB1762.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Tue, 5 Oct 2021 09:11:16 +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 09:11:16 +0000 From: Enze Li To: bug-gnulib@gnu.org Cc: gdb@sourceware.org, simon.marchi@polymtl.ca Subject: [PATCH] Fix a wrong expression Date: Tue, 5 Oct 2021 17:10:58 +0800 Message-ID: X-Mailer: git-send-email 2.30.2 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [o+XpDnxB+AW1tE63Eb3TsPVN2kB6+6go] X-ClientProxiedBy: HK2PR04CA0043.apcprd04.prod.outlook.com (2603:1096:202:14::11) To MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:71::10) X-Microsoft-Original-Message-ID: <20211005091058.6193-1-lienze2010@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from asus.workspace (61.48.214.232) by HK2PR04CA0043.apcprd04.prod.outlook.com (2603:1096:202:14::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Tue, 5 Oct 2021 09:11:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d78d564-9928-487e-04ab-08d987e01632 X-MS-TrafficTypeDiagnostic: ME3P282MB1762: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 93c6d4d6GkAxIhUq0gsOaLmQTLelBD6Dnf05mbqYDc8r8TidyzHlY2mOyxy0lQx8pWz64sGuG+x+5AS4QhVstchabHlVBanvdzIgPIxgq1stoIcuMp9B6hltWm8CxCMRdQP9j0m3eZlmuFyAgXUMQs+yrKq1rLNELaynj6aXZvXNe2Tzesw3J+8tiufHKG2bhMJh9s8t5ytcP0Ml6wmQti4wDdUw+7iEKu+y4zbvbFgS/jTMFWsqwlOv6zYdyX0YYnAXEkBianUm9bAAdfJQMfVrhd3gIXhwhDSUBU8tE0f8L5GuBiJkdTKk74BUtZRsJxefCJGs85VadDlUytoC9gBbqaB6oClAekfDy+xnNh/hecFcmTyAXEzj809ZJaI0uiGiYIIg4tME6gshMZvFiYRK0FVUjfhVRqdC+FwWNSdSaUSRIWbEuWjGOHNEV0tdA9B7JFmvqFck+TuSVsDwnTyVC1z/4Exg0RhHOcv0muU= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jnNRxEhD8RRyHxYo7zUZmLH3+wfjyfxGW4lFa/2Uw5HsFcqUSFRITjETlK7/IMnvXDgu7nkEtycTBrqeqKjg2aoIE3ojx72mnoZdjF+bC+LQI/n3oIVSb106oRBrZ/GLepQKw6+XYD5j/UOpOhXevA== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-8dac2.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 6d78d564-9928-487e-04ab-08d987e01632 X-MS-Exchange-CrossTenant-AuthSource: MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2021 09:11:16.6455 (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: ME3P282MB1762 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2021 09:11:28 -0000 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. 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. * lib/c++defs.h (_GL_CXXALIASWARN_2, _GL_CXXALIASWARN1_2): Don't enable the GCC workaround to clang. --- lib/c++defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/c++defs.h b/lib/c++defs.h index a47b61a00..b982b88f6 100644 --- a/lib/c++defs.h +++ b/lib/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