[llvm] r220384 - Fixing a -Wsign-compare warning; NFC.

Aaron Ballman aaron at aaronballman.com
Wed Oct 22 06:09:43 PDT 2014


Author: aaronballman
Date: Wed Oct 22 08:09:43 2014
New Revision: 220384

URL: http://llvm.org/viewvc/llvm-project?rev=220384&view=rev
Log:
Fixing a -Wsign-compare warning; NFC.

I think it might make sense to make COFF::MaxNumberOfSections16 be a uint32_t, however, that may have wider-reaching implications in other projects, which is why I did not change that declaration.

Modified:
    llvm/trunk/tools/yaml2obj/yaml2coff.cpp

Modified: llvm/trunk/tools/yaml2obj/yaml2coff.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2coff.cpp?rev=220384&r1=220383&r2=220384&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2coff.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2coff.cpp Wed Oct 22 08:09:43 2014
@@ -37,7 +37,8 @@ struct COFFParser {
   }
 
   bool useBigObj() const {
-    return Obj.Sections.size() > COFF::MaxNumberOfSections16;
+    return static_cast<int32_t>(Obj.Sections.size()) >
+           COFF::MaxNumberOfSections16;
   }
 
   unsigned getHeaderSize() const {





More information about the llvm-commits mailing list