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 4A5743858D38; Wed, 12 Oct 2022 17:37:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A5743858D38 Received: from [10.0.0.85] (modemcable162.249-56-74.mc.videotron.ca [74.56.249.162]) (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 9E6381E0D3; Wed, 12 Oct 2022 13:36:59 -0400 (EDT) Message-ID: <47e52da6-55b5-bbab-a1da-aabde2d37125@simark.ca> Date: Wed, 12 Oct 2022 13:36:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH v2 4/4] gdb: Suppress "unused" variable warning on Clang To: Tsukasa OI , Pedro Alves , Joel Brobecker , Enze Li Cc: binutils@sourceware.org, gdb-patches@sourceware.org References: <189b22f1db46c1ffbb248aeca8b5753da4070f2c.1663835104.git.research_trasio@irq.a4lg.com> Content-Language: fr From: Simon Marchi In-Reply-To: <189b22f1db46c1ffbb248aeca8b5753da4070f2c.1663835104.git.research_trasio@irq.a4lg.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 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: Wed, 12 Oct 2022 17:37:03 -0000 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