public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Remove unused extra_lines variable
@ 2022-09-25  8:17 Tsukasa OI
  2022-09-26  9:00 ` Bruno Larsen
  2022-09-29 17:22 ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Tsukasa OI @ 2022-09-25  8:17 UTC (permalink / raw)
  To: Tsukasa OI; +Cc: gdb-patches

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<linetable_entry> &old_linetable)
 {
-  int extra_lines = 0;
-
   std::vector<linetable_entry> fentries;
 
   for (int ii = 0; ii < old_linetable.size (); ++ii)
@@ -436,12 +434,6 @@ arrange_linetable (std::vector<linetable_entry> &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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-30 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25  8:17 [PATCH] gdb: Remove unused extra_lines variable Tsukasa OI
2022-09-26  9:00 ` Bruno Larsen
2022-09-30 15:50   ` Tsukasa OI
2022-09-29 17:22 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).