From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id C62E73858C50 for ; Sun, 25 Sep 2022 08:17:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C62E73858C50 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 05F5E300089; Sun, 25 Sep 2022 08:17:52 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI Cc: gdb-patches@sourceware.org Subject: [PATCH] gdb: Remove unused extra_lines variable Date: Sun, 25 Sep 2022 08:17:42 +0000 Message-Id: <3090ae2157c8eae596b1bf5989c1853b865fdacf.1664093762.git.research_trasio@irq.a4lg.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, 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, 25 Sep 2022 08:17:59 -0000 Clang generates a warning if there is a variable that is set but not used otherwise ("-Wunused-but-set-variable"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). The only extra_lines use in arrange_linetable function is removed on the commit 558802e4d1c5dcbd0df7d2c6ef62a6deac247a2f ("gdb: change subfile::line_vector to an std::vector"). So, this variable should be removed to prevent a build failure. gdb/ChangeLog: * xcoffread.c (arrange_linetable): Remove unused extra_lines. --- gdb/xcoffread.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index b7d65771115..aa88cbc724d 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -419,8 +419,6 @@ add_stab_to_list (char *stabname, struct pending_stabs **stabvector) static void arrange_linetable (std::vector &old_linetable) { - int extra_lines = 0; - std::vector fentries; for (int ii = 0; ii < old_linetable.size (); ++ii) @@ -436,12 +434,6 @@ arrange_linetable (std::vector &old_linetable) e.line = ii; e.is_stmt = 1; e.pc = old_linetable[ii].pc; - - /* If the function was compiled with XLC, we may have to add an - extra line entry later. Reserve space for that. */ - if (ii + 1 < old_linetable.size () - && old_linetable[ii].pc != old_linetable[ii + 1].pc) - extra_lines++; } } base-commit: 58d69206b8173b9d027a6c65f56cdaf045ae6e64 -- 2.34.1