]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd: drop unused elt_no
authorSam James <sam@gentoo.org>
Thu, 17 Jul 2025 12:16:31 +0000 (13:16 +0100)
committerSam James <sam@gentoo.org>
Thu, 17 Jul 2025 12:16:31 +0000 (13:16 +0100)
GCC trunk recently had improvements to its -Wunused-but-set-variable which
picked up that elt_no isn't used at all in the end.

* archive.c (_bfd_compute_and_write_armap): Drop unused elt_no.

bfd/archive.c

index 8e20554d781acfdb400c6f42cf7fc02e008812ee..c61d4b126586981b3ebd1d720ef330c109410a1e 100644 (file)
@@ -2299,7 +2299,6 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
 {
   char *first_name = NULL;
   bfd *current;
-  file_ptr elt_no = 0;
   struct orl *map = NULL;
   unsigned int orl_max = 1024;         /* Fine initial default.  */
   unsigned int orl_count = 0;
@@ -2334,7 +2333,7 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
   /* Map over each element.  */
   for (current = arch->archive_head;
        current != NULL;
-       current = current->archive_next, elt_no++)
+       current = current->archive_next)
     {
       if (bfd_check_format (current, bfd_object)
          && (bfd_get_file_flags (current) & HAS_SYMS) != 0)