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

Issues when building with GCC 11 #70

Closed
bensuperpc opened this issue Oct 14, 2021 · 0 comments
Closed

Issues when building with GCC 11 #70

bensuperpc opened this issue Oct 14, 2021 · 0 comments

Comments

@bensuperpc
Copy link
Contributor

bensuperpc commented Oct 14, 2021

I would like to build cpuinfo but i got an error while compiling googletest:

ninja: Entering directory `build'
[1/8] Building CXX object deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
FAILED: deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o 
/usr/bin/c++  -I"/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/include" -I"/run/media/bensuperpc/cpuinfo/deps/googletest/googletest" -Wall -Wshadow -Werror -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -pthread -std=c++11 -MD -MT deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -MF deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o.d -o deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -c '/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-all.cc'
Dans le fichier inclus depuis /run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-all.cc:42:
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc: Dans la fonction « bool testing::internal::StackGrowsDown() »:
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc:1301:24: erreur: « dummy » pourrait être utilisé sans avoir été initialisé [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc:1290:13: note: par l'argument 1 de type « const void* » à « void testing::internal::StackLowerThanAddress(const void*, bool*) » déclaré ici
 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc:1299:7: note: « dummy » déclaré ici
 1299 |   int dummy;
      |       ^~~~~
cc1plus : tous les avertissements sont traités comme des erreurs
ninja: build stopped: subcommand failed.

I tested with Manjaro and dockcross, same issues.
Used commands:

mkdir -p build
cmake -S . -B build -G Ninja
ninja -C build

GCC info:

Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/lto-wrapper
Cible : x86_64-pc-linux-gnu
Configuré avec: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Modèle de thread: posix
Algorithmes de compression LTO supportés: zlib zstd
gcc version 11.1.0 (GCC) 

I think it's related: google/googletest#3219

@bensuperpc bensuperpc changed the title Issues when building with CMake Issues when building with GCC 11 Oct 14, 2021
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

1 participant