Skip to content

Commit

Permalink
gdb: Remove unused extra_lines variable
Browse files Browse the repository at this point in the history
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 558802e
("gdb: change subfile::line_vector to an std::vector").  So, this variable
should be removed to prevent a build failure.
  • Loading branch information
a4lg committed Sep 28, 2022
1 parent 67d1991 commit 44d5ccb
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions gdb/xcoffread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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++;
}
}

Expand Down

0 comments on commit 44d5ccb

Please sign in to comment.