Skip to content

CMake fails during googletest step with gcc 11.1.0 #798

Closed
@FerdinandSpitzschnueffler

Description

Required information

Operating system:
Arch Linux

Compiler version:
GCC 11.1.0

Observed result or behaviour:
CMake fails during googletest step:
[ 12%] Building CXX object googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from .../build/dependencies/googletest/src/googletest/src/gtest-all.cc:42:
.../build/dependencies/googletest/src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
.../build/dependencies/googletest/src/googletest/src/gtest-death-test.cc:1224:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
1224 | StackLowerThanAddress(&dummy, &result);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
.../build/dependencies/googletest/src/googletest/src/gtest-death-test.cc:1214:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
1214 | static void StackLowerThanAddress(const void* ptr, bool* result) {
| ^~~~~~~~~~~~~~~~~~~~~
.../build/dependencies/googletest/src/googletest/src/gtest-death-test.cc:1222:7: note: ‘dummy’ declared here
1222 | int dummy;
| ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [googlemock/gtest/CMakeFiles/gtest.dir/build.make:76: googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:198: googlemock/gtest/CMakeFiles/gtest.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
CMake Error at .../cmake/googletest/CMakeLists.txt:77 (message):
Build step [build and install] for googletest failed: 2

Expected result or behaviour:
CMake doesn't fail

Conditions where it occurred / Performed steps:
cmake -Bbuild -Hiceoryx_meta -DBUILD_TEST=ON

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions