[llvm-dev] minor error message fix patch

Andrew Kelley via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 21 13:56:46 PDT 2017


Index: lib/DebugInfo/DWARF/DWARFContext.cpp
===================================================================
--- lib/DebugInfo/DWARF/DWARFContext.cpp (revision 298436)
+++ lib/DebugInfo/DWARF/DWARFContext.cpp (working copy)
@@ -797,7 +797,7 @@
         }

         if (Address + R.Width > SectionSize) {
-          errs() << "error: " << R.Width << "-byte relocation starting "
+          errs() << "error: " << format("%d", R.Width) << "-byte
relocation starting "
                  << Address << " bytes into section " << name << " which
is "
                  << SectionSize << " bytes long.\n";
           continue;



otherwise you can get something like this printed, because R.Width is of
type `char`:

error: -byte relocation starting 179 bytes into section rela.debug_info
which is 177 bytes long.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170321/53ac6169/attachment.html>


More information about the llvm-dev mailing list