]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libcpu/i386_parse.y: drop unused `cnt` variable
authorSergei Trofimovich <slyich@gmail.com>
Fri, 14 Nov 2025 09:44:55 +0000 (09:44 +0000)
committerAaron Merey <amerey@redhat.com>
Fri, 14 Nov 2025 15:04:01 +0000 (10:04 -0500)
Without the change the build fails on `gcc-16` as:

    i386_parse.y: In function 'instrtable_out':
    i386_parse.y:1245:10: error: variable 'cnt' set but not used [-Werror=unused-but-set-variable=]
     1245 |   size_t cnt = 0;
          |          ^~~

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
libcpu/i386_parse.y

index 5c91e520c0ae189dbe5a8056d1a1e444e824a1cc..afe488fc843fec28f9e3882d8ca9fedc9eaa87f5 100644 (file)
@@ -1242,8 +1242,7 @@ instrtable_out (void)
   fputs ("};\n", outfile);
 
   fputs ("static const uint8_t match_data[] =\n{\n", outfile);
-  size_t cnt = 0;
-  for (instr = instructions; instr != NULL; instr = instr->next, ++cnt)
+  for (instr = instructions; instr != NULL; instr = instr->next)
     {
       /* First count the number of bytes.  */
       size_t totalbits = 0;