[llvm] c1f8595 - [Support] Silence warning in Path unittests when compiling with clang-cl

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 23 09:20:37 PDT 2020


Author: Alexandre Ganea
Date: 2020-03-23T12:20:18-04:00
New Revision: c1f8595fe5b856222418e2de547f0e346d84ac84

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

LOG: [Support] Silence warning in Path unittests when compiling with clang-cl

warning: comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Wsign-compare]

Added: 
    

Modified: 
    llvm/unittests/Support/Path.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index affba601a8bc..671966b52dd0 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -1895,7 +1895,7 @@ TEST_F(FileSystemTest, widenPath) {
   // Result should not start with the long path prefix.
   EXPECT_TRUE(std::wmemcmp(Result.data(), LongPathPrefix.c_str(),
                            LongPathPrefix.size()) != 0);
-  EXPECT_EQ(Result.size(), MAX_PATH - 1);
+  EXPECT_EQ(Result.size(), (size_t)MAX_PATH - 1);
 
   // Add another Pi to exceed the MAX_PATH limit.
   Input += Pi;
@@ -1921,7 +1921,7 @@ TEST_F(FileSystemTest, widenPath) {
   // Result should not start with the long path prefix.
   EXPECT_TRUE(std::wmemcmp(Result.data(), LongPathPrefix.c_str(),
                            LongPathPrefix.size()) != 0);
-  EXPECT_EQ(Result.size(), MAX_PATH - 1);
+  EXPECT_EQ(Result.size(), (size_t)MAX_PATH - 1);
 
   // Extend the directory name so the input exceeds the MAX_PATH limit.
   DirName += DirChar;


        


More information about the llvm-commits mailing list