From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id AC0183858D28 for ; Mon, 17 Oct 2022 12:35:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC0183858D28 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 2DADB1E0D3; Mon, 17 Oct 2022 08:35:04 -0400 (EDT) Message-ID: Date: Mon, 17 Oct 2022 08:35:04 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v2 4/4] gdb: Suppress "unused" variable warning on Clang Content-Language: en-US To: Tsukasa OI Cc: gdb-patches@sourceware.org References: <189b22f1db46c1ffbb248aeca8b5753da4070f2c.1663835104.git.research_trasio@irq.a4lg.com> <47e52da6-55b5-bbab-a1da-aabde2d37125@simark.ca> From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 17 Oct 2022 12:35:07 -0000 On 2022-10-16 09:37, Tsukasa OI via Gdb-patches wrote: > On 2022/10/13 2:36, Simon Marchi wrote: >> On 9/22/22 04:25, Tsukasa OI via Gdb-patches wrote: >>> Clang generates a warning if there is a variable which is written but not >>> read thereafter. By the default configuration (with "-Werror"), it causes a >>> build failure (unless "--disable-werror" is specified). >>> >>> Because the cause of this error is in the Bison-generated code >>> ($(srcdir)/gdb/cp-name-parser.y -> $(builddir)/gdb/cp-name-parser.c), >>> this commit suppresses this warning ("-Wunused-but-set-variable") by placing >>> the DIAGNOSTIC_IGNORE_UNUSED_BUT_SET_VARIABLE macro at the end of user >>> prologue of cp-name-parser.y. >> >> Hi, >> >> I just sent a patch to fix the same thing as your patch here, but only >> saw your patch after. However, I took a different, more fine-grained >> approach: >> >> https://inbox.sourceware.org/gdb-patches/20221012173256.20079-1-simon.marchi@efficios.com/T/#u >> >> Can you let me know what you think? >> >> Simon >> > > I always prefer fine-grained approach if we can. The only reason I > didn't do that on gold is because I didn't know proper place for "(void) > yynerrs". I cannot approve (as I'm not a maintainer) but I support your > patchset. Ok, thanks for the feedback, I will push my version. Simon