[lld] r335848 - Fix warning on MSVC by using size_t arithmetic instead of casting after the fact. NFC

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 05:38:43 PDT 2018


Author: filcab
Date: Thu Jun 28 05:38:43 2018
New Revision: 335848

URL: http://llvm.org/viewvc/llvm-project?rev=335848&view=rev
Log:
Fix warning on MSVC by using size_t arithmetic instead of casting after the fact. NFC

Modified:
    lld/trunk/COFF/SymbolTable.cpp

Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=335848&r1=335847&r2=335848&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Thu Jun 28 05:38:43 2018
@@ -189,7 +189,7 @@ void SymbolTable::reportRemainingUndefin
   }
 
   for (ObjFile *File : ObjFile::Instances) {
-    size_t SymIndex = -1ull;
+    size_t SymIndex = size_t{0} - 1;
     for (Symbol *Sym : File->getSymbols()) {
       ++SymIndex;
       if (!Sym)




More information about the llvm-commits mailing list