[llvm] r246839 - WinCOFFObjectWriter.cpp: Appease a warning in checking std::time_t. [-Wsign-compare]

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 22:19:37 PDT 2015


Author: chapuni
Date: Fri Sep  4 00:19:37 2015
New Revision: 246839

URL: http://llvm.org/viewvc/llvm-project?rev=246839&view=rev
Log:
WinCOFFObjectWriter.cpp: Appease a warning in checking std::time_t. [-Wsign-compare]

Modified:
    llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp

Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=246839&r1=246838&r2=246839&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Fri Sep  4 00:19:37 2015
@@ -1016,7 +1016,7 @@ void WinCOFFObjectWriter::writeObject(MC
   // MS LINK expects to be able to use this timestamp to implement their
   // /INCREMENTAL feature.
   std::time_t Now = time(nullptr);
-  if (Now < 0 || Now > UINT32_MAX)
+  if (Now < 0 || (unsigned long)Now > UINT32_MAX)
     Now = UINT32_MAX;
   Header.TimeDateStamp = Now;
 




More information about the llvm-commits mailing list