]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: Fix set but not used variable
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 6 Feb 2023 22:25:07 +0000 (23:25 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 8 Feb 2023 17:04:21 +0000 (18:04 +0100)
clang complains:

    readelf.c:10250:10: error: variable 'nculist' set but not used [-Werror,-Wunused-but-set-variable]
      size_t nculist = 0;
             ^

Fix by deleting it.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
src/readelf.c

index 51b0e8b91154222d1f370eba3f64a090664c72e1..0bbd708e109a2a14fe51571af186ffd62e4a9a03 100644 (file)
@@ -10247,7 +10247,6 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
   Dwarf_Off ncu = 0;
   size_t hsize;
   struct mac_culist *culist = NULL;
-  size_t nculist = 0;
   while (dwarf_nextcu (dbg, offset = ncu, &ncu, &hsize, NULL, NULL, NULL) == 0)
     {
       Dwarf_Die cudie;
@@ -10268,7 +10267,6 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
       newp->files = NULL;
       newp->next = culist;
       culist = newp;
-      ++nculist;
     }
 
   const unsigned char *readp = (const unsigned char *) data->d_buf;