[lld] 3fec25c - [LLD] Silence warning when compiling with MSVC targetting x86

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 06:34:33 PST 2024


Author: Alexandre Ganea
Date: 2024-01-25T09:34:17-05:00
New Revision: 3fec25c55f1890c138e64548dc074b4593e0a26c

URL: https://github.com/llvm/llvm-project/commit/3fec25c55f1890c138e64548dc074b4593e0a26c
DIFF: https://github.com/llvm/llvm-project/commit/3fec25c55f1890c138e64548dc074b4593e0a26c.diff

LOG: [LLD] Silence warning when compiling with MSVC targetting x86

This fixes:
```
[5383/6995] Building CXX object tools\lld\COFF\CMakeFiles\lldCOFF.dir\PDB.cpp.obj
C:\git\llvm-project\lld\COFF\PDB.cpp(835): warning C4018: '>=': signed/unsigned mismatch
```

Added: 
    

Modified: 
    lld/COFF/PDB.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index 8b81a71e8fb6f9..35e4c68dcda6c8 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -832,7 +832,7 @@ void DebugSHandler::advanceRelocIndex(SectionChunk *sc,
   assert(vaBegin > 0);
   auto relocs = sc->getRelocs();
   for (; nextRelocIndex < relocs.size(); ++nextRelocIndex) {
-    if (relocs[nextRelocIndex].VirtualAddress >= vaBegin)
+    if (relocs[nextRelocIndex].VirtualAddress >= (uint32_t)vaBegin)
       break;
   }
 }


        


More information about the llvm-commits mailing list