[llvm] r200801 - Silence a warning:

Chandler Carruth chandlerc at gmail.com
Tue Feb 4 14:53:45 PST 2014


Author: chandlerc
Date: Tue Feb  4 16:53:45 2014
New Revision: 200801

URL: http://llvm.org/viewvc/llvm-project?rev=200801&view=rev
Log:
Silence a warning:

In file included from ../unittests/Support/ProcessTest.cpp:11:
../utils/unittest/googletest/include/gtest/gtest.h:1448:28: warning: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(NE, !=);
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
../utils/unittest/googletest/include/gtest/gtest.h:1433:12: note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
  if (val1 op val2) {\
           ^
../unittests/Support/ProcessTest.cpp:46:3: note: in instantiation of function template specialization 'testing::internal::CmpHelperNE<unsigned int, int>' requested here
  EXPECT_NE((r1 | r2), 0);
  ^

Modified:
    llvm/trunk/unittests/Support/ProcessTest.cpp

Modified: llvm/trunk/unittests/Support/ProcessTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ProcessTest.cpp?rev=200801&r1=200800&r2=200801&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ProcessTest.cpp (original)
+++ llvm/trunk/unittests/Support/ProcessTest.cpp Tue Feb  4 16:53:45 2014
@@ -43,7 +43,7 @@ TEST(ProcessTest, GetRandomNumberTest) {
   const unsigned r1 = Process::GetRandomNumber();
   const unsigned r2 = Process::GetRandomNumber();
   // It should be extremely unlikely that both r1 and r2 are 0.
-  EXPECT_NE((r1 | r2), 0);
+  EXPECT_NE((r1 | r2), 0u);
 }
 
 #ifdef _MSC_VER





More information about the llvm-commits mailing list