From 22d41ba024fa08026ebd85ec842712fcf780ca2a Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 30 Oct 2019 15:18:21 -0700 Subject: [PATCH] Fix -Wsign-compare warning with clang-cl off_t apparently is just "long" on Win64, which is 32-bits, and therefore not long enough to compare with UINT32_MAX. Use auto to follow the surrounding code. uint64_t would also be fine. --- llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp b/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp index ad022fec9e32..e234a13fe06b 100644 --- a/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp +++ b/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp @@ -114,7 +114,7 @@ llvm::Expected FunctionInfo::encode(FileWriter &O) const { llvm::Error err = OptLineTable->encode(O, Range.Start); if (err) return std::move(err); - const off_t Length = O.tell() - StartOffset; + const auto Length = O.tell() - StartOffset; if (Length > UINT32_MAX) return createStringError(std::errc::invalid_argument, "LineTable length is greater than UINT32_MAX"); @@ -132,7 +132,7 @@ llvm::Expected FunctionInfo::encode(FileWriter &O) const { llvm::Error err = Inline->encode(O, Range.Start); if (err) return std::move(err); - const off_t Length = O.tell() - StartOffset; + const auto Length = O.tell() - StartOffset; if (Length > UINT32_MAX) return createStringError(std::errc::invalid_argument, "InlineInfo length is greater than UINT32_MAX");