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

Error: ‘dummy’ may be used uninitialized #160

Open
VJalili opened this issue May 23, 2022 · 1 comment
Open

Error: ‘dummy’ may be used uninitialized #160

VJalili opened this issue May 23, 2022 · 1 comment

Comments

@VJalili
Copy link

VJalili commented May 23, 2022

I am building EH from source following the steps listed on the installation page. I get the following error when building EH.

$ git clone https://github.com/Illumina/ExpansionHunter
$ cd ExpansionHunter/
$ mkdir build
$ cd build
$ cmake ..
$ make
...
[ 12%] Building CXX object googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from /home/user/ExpansionHunter/build/googletest-prefix/src/googletest/googletest/src/gtest-all.cc:42:
/home/user/ExpansionHunter/build/googletest-prefix/src/googletest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/user/ExpansionHunter/build/googletest-prefix/src/googletest/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/user/ExpansionHunter/build/googletest-prefix/src/googletest/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/user/ExpansionHunter/build/googletest-prefix/src/googletest/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
 1299 |   int dummy;
      |       ^~~~~
cc1plus: all warnings being treated as errors
make[5]: *** [googletest/CMakeFiles/gtest.dir/build.make:76: googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:172: googletest/CMakeFiles/gtest.dir/all] Error 2
make[3]: *** [Makefile:146: all] Error 2
make[2]: *** [CMakeFiles/googletest.dir/build.make:86: googletest-prefix/src/googletest-stamp/googletest-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:171: CMakeFiles/googletest.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I'm running on Ubuntu, 22.04.

I believe this error is related to the issue discussed here, so I tried reinstalling the current latest release of google test following these instructions. That did not fix the error.

@ccario83
Copy link

This is a known googletest issue when compiling with GCC 11. It can be solved by upgrading googletest to 1.11:

CMakeLists.txt, line 65, change:

URL https://github.com/google/googletest/archive/refs/tags/release-1.10.0.tar.gz

to

URL https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz

You may have other errors compiling ExpansionHunter with GCC11, however. It may be better to downgrade the compilier. 🤷

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

No branches or pull requests

2 participants