build tests fail with g++ 11.2.0 and clang++-13
jpicht opened this issue · 1 comments
jpicht commented
Hi, I just tried using this project, sadly the tests seem to be broken, when building with g++ 11 or clang++ 13.
Expected result: no compiler error
Actual result:
/usr/bin/c++ -I.../build/_deps/lazycsv-src/include -isystem .../build/_deps/lazycsv-src/test/doctest -Wall -Wfatal-errors -Wextra -Wnon-virtual-dtor -pedantic -std=gnu++17 -o CMakeFiles/driver.dir/main.cpp.o -c .../build/_deps/lazycsv-src/test/main.cpp
In file included from .../build/_deps/lazycsv-src/test/main.cpp:4:
.../build/_deps/lazycsv-src/test/doctest/doctest.h:4032:47: error: size of array ‘altStackMem’ is not an integral constant-expression
4032 | static char altStackMem[4 * SIGSTKSZ];
| ^
compilation terminated due to -Wfatal-errors.
clang++-13 -I.../build/_deps/lazycsv-src/include -isystem .../build/_deps/lazycsv-src/test/doctest -Wall -Wfatal-errors -Wextra -Wnon-virtual-dtor -pedantic -std=gnu++17 -o CMakeFiles/driver.dir/main.cpp.o -c .../build/_deps/lazycsv-src/test/main.cpp
In file included from .../build/_deps/lazycsv-src/test/main.cpp:4:
.../build/_deps/lazycsv-src/test/doctest/doctest.h:4032:33: fatal error: variable length array declaration not allowed at file scope
static char altStackMem[4 * SIGSTKSZ];
^ ~~~~~~~~~~~~
1 error generated.
Compiler versions
g++ (Ubuntu 11.2.0-7ubuntu2) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Ubuntu clang version 13.0.0-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Steps to reproduce:
- clone current version
- try to compile tests with g++ 11 or clang++ 13
ashtum commented
Hi, thanks for your report.
The problem is inside doctest
framework, unfortunately I couldn't reproduce it with g++-11
and clang++-13
in ubuntu 21.04. It seems it only occurs with glibc 2.34
.
Anyway I have updated "doctest.h" to latest version. Please check if problem is solved.