Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Test build failure Ubuntu 20.04 CMake 3.16.3 g++ 13.1 #12

Open
daggilli opened this issue Jun 28, 2024 · 1 comment
Open

Google Test build failure Ubuntu 20.04 CMake 3.16.3 g++ 13.1 #12

daggilli opened this issue Jun 28, 2024 · 1 comment

Comments

@daggilli
Copy link

daggilli commented Jun 28, 2024

As cloned from branch master, the cmake step for Ubuntu/gcc fails while building Google Test. The error is a possibly uninitialised variable "dummy".

In file included from XXX/.hunter/_Base/0a8ede4/792e364/69c73d8/Build/GTest/Source/googletest/src/gtest-all.cc:42:
XXX/.hunter/_Base/0a8ede4/792e364/69c73d8/Build/GTest/Source/googletest/src/gtest-death-test.cc: In function
‘bool testing::internal::StackGrowsDown()’:
XXX/.hunter/_Base/0a8ede4/792e364/69c73d8/Build/GTest/Source/googletest/src/gtest-death-test.cc:1301:24: 
error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
XXX/.hunter/_Base/0a8ede4/792e364/69c73d8/Build/GTest/Source/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) {
      |             ^~~~~~~~~~~~~~~~~~~~~
XXX/.hunter/_Base/0a8ede4/792e364/69c73d8/Build/GTest/Source/googletest/src/gtest-death-test.cc:1299:7: note:
‘dummy’ declared here
 1299 |   int dummy;

This appears to be the result of CMake trying to use an obsolete version of hunter. It is resolved by setting the huntergate URL in line 6 of CMakeLists.txt to the latest version, found at https://github.com/cpp-pm/hunter/releases (0.25.6 at time of writing).

@utsusemioxo
Copy link

It works for me ! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants