]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
coregrind/m_debuginfo/readpdb.c (DEBUG_SnarfLinetab): Remove this_seg
authorMark Wielaard <mark@klomp.org>
Fri, 17 Oct 2025 23:27:57 +0000 (01:27 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 17 Oct 2025 23:35:43 +0000 (01:35 +0200)
GCC notices that this_seg is set, but never really used in this
function

m_debuginfo/readpdb.c: In function 'DEBUG_SnarfLinetab':
m_debuginfo/readpdb.c:1542:23: warning: variable 'this_seg' set but not used [-Wunused-but-set-variable=]
 1542 |    Int                this_seg;
      |                       ^~~~~~~~

Fix this by just removing this_seg.

coregrind/m_debuginfo/readpdb.c

index dbae197b32beadf7305fa2e40d5812a913f5fa1a..9e29fefb154e63d90747fdaad00f4eec9e1dbf4f 100644 (file)
@@ -1539,7 +1539,6 @@ static ULong DEBUG_SnarfLinetab(
    union any_size     pnt;
    union any_size     pnt2;
    const struct startend * start;
-   Int                this_seg;
 
    Bool  debug = di->trace_symtab;
    ULong n_lines_read = 0;
@@ -1563,7 +1562,6 @@ static ULong DEBUG_SnarfLinetab(
       pnt2.c = (const HChar *)linetab + filetab[i];
    }
 
-   this_seg = 0;
    for (i = 0; i < nfile; i++) {
       const HChar *fnmstr;
       const HChar *dirstr;
@@ -1601,7 +1599,7 @@ static ULong DEBUG_SnarfLinetab(
       fnmstr = ML_(addStr)(di, fnmstr, k);
       fnmdirstr_ix = ML_(addFnDn) (di, fnmstr, dirstr);
 
-      for (k = 0; k < file_segcount; k++, this_seg++) {
+      for (k = 0; k < file_segcount; k++) {
          Int linecount;
          Int segno;