dmlc / dmlc-core

A common bricks library for building scalable and portable distributed machine learning.
Apache License 2.0
864 stars 520 forks source link

Upgrade Google Test to 1.11.0 #667

Closed rongou closed 2 years ago

rongou commented 2 years ago

With newer versions of gcc, gtest 1.10.0 causes a compile warning/error:

In file included from /home/rou/src/xgboost-cpp/cmake-build-debug/googletest-src/googletest/src/gtest-all.cc:42:
/home/rou/src/xgboost-cpp/cmake-build-debug/googletest-src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/rou/src/xgboost-cpp/cmake-build-debug/googletest-src/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/rou/src/xgboost-cpp/cmake-build-debug/googletest-src/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/home/rou/src/xgboost-cpp/cmake-build-debug/googletest-src/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
 1299 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors

@hcho3 @trivialfis

hcho3 commented 2 years ago

Superseded by #668