From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id A2E193858D3C for ; Sun, 16 Oct 2022 13:37:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2E193858D3C Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 0A3C8300089; Sun, 16 Oct 2022 13:37:49 +0000 (UTC) Message-ID: Date: Sun, 16 Oct 2022 22:37:47 +0900 Mime-Version: 1.0 Subject: Re: [PATCH v2 4/4] gdb: Suppress "unused" variable warning on Clang Content-Language: en-US To: Simon Marchi Cc: gdb-patches@sourceware.org References: <189b22f1db46c1ffbb248aeca8b5753da4070f2c.1663835104.git.research_trasio@irq.a4lg.com> <47e52da6-55b5-bbab-a1da-aabde2d37125@simark.ca> From: Tsukasa OI In-Reply-To: <47e52da6-55b5-bbab-a1da-aabde2d37125@simark.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_NONE, 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: Sun, 16 Oct 2022 13:37:52 -0000 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. Thanks, Tsukasa