]> sourceware.org Git - valgrind.git/commitdiff
Fix indentation in coregrind/m_debuginfo/readpdb.c (DEBUG_SnarfLinetab)
authorMark Wielaard <mark@klomp.org>
Sat, 23 Jan 2021 19:22:28 +0000 (20:22 +0100)
committerMark Wielaard <mark@klomp.org>
Sat, 23 Jan 2021 19:26:28 +0000 (20:26 +0100)
GCC warns:

readpdb.c:1631:16: warning: this 'if' clause does not guard...
  [-Wmisleading-indentation]
 1631 |                if (debug)
      |                ^~
In file included from ./pub_core_basics.h:38,
                 from m_debuginfo/readpdb.c:38:
../include/pub_tool_basics.h:69:30: note: ...this statement, but the latter
  is misleadingly indented as if it were guarded by the 'if'
   69 | #define ML_(str)    VGAPPEND(vgModuleLocal_,    str)
      |                              ^~~~~~~~~~~~~~
../include/pub_tool_basics.h:66:29: note: in definition of macro 'VGAPPEND'
   66 | #define VGAPPEND(str1,str2) str1##str2
      |                             ^~~~
m_debuginfo/readpdb.c:1636:19: note: in expansion of macro 'ML_'
 1636 |                   ML_(addLineInfo)(
      |                   ^~~

The warning message is slightly hard to read because of the macro expansion.
But GCC is right that the indentation is misleading. Fixed by reindenting.

coregrind/m_debuginfo/readpdb.c

index 6522383547d858bac6b794f7b016861835a5bfc5..f9128e30cfc510a5df4dafa5f24cb9bbff5cbdc9 100644 (file)
@@ -1633,16 +1633,16 @@ static ULong DEBUG_SnarfLinetab(
                      "  Adding line %d addr=%#lx end=%#lx\n", 
                      ((const unsigned short *)(pnt2.ui + linecount))[j],
                      startaddr, endaddr );
-                  ML_(addLineInfo)(
-                     di, 
-                     fnmdirstr_ix,
-                     startaddr, endaddr,
-                     ((const unsigned short *)(pnt2.ui + linecount))[j], j );
-                  n_lines_read++;
-               }
+               ML_(addLineInfo)(
+                   di,
+                   fnmdirstr_ix,
+                   startaddr, endaddr,
+                   ((const unsigned short *)(pnt2.ui + linecount))[j], j );
+               n_lines_read++;
             }
-        }
-    }
+         }
+      }
+   }
 
    if (debug)
       VG_(umsg)("END SnarfLineTab linetab=%p size=%d\n", 
This page took 0.035675 seconds and 5 git commands to generate.