From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 60319385801A for ; Mon, 4 Oct 2021 16:14:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60319385801A Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 194GE4iC026645 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Oct 2021 12:14:09 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 194GE4iC026645 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 68E9F1E813; Mon, 4 Oct 2021 12:14:04 -0400 (EDT) Message-ID: <6d03de6a-0760-2894-3845-dd9dec5c703a@polymtl.ca> Date: Mon, 4 Oct 2021 12:14:04 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [PATCH] gdb: Fix build error on macOS Content-Language: en-US To: Enze Li , gdb-patches@sourceware.org References: From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 4 Oct 2021 16:14:04 +0000 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: Mon, 04 Oct 2021 16:14:20 -0000 On 2021-10-04 06:03, 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). Thanks for addressing this. Please send the patch to upstream gnulib, to the following mailing list: https://lists.gnu.org/mailman/listinfo/bug-gnulib Then we can pull the updated feedback. Otherwise, we can always have a local patch in binutils-gdb/gnulib/patches, but if the change is correct, I don't see why it wouldn't be accepted in upstream gnulib. Thanks, Simon