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
With newer versions of gcc, gtest 1.10.0 causes a compile warning/error:
@hcho3 @trivialfis