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

clang-14 build failure on ext/catch #322

Open
jhgorse opened this issue Jan 7, 2024 · 1 comment
Open

clang-14 build failure on ext/catch #322

jhgorse opened this issue Jan 7, 2024 · 1 comment

Comments

@jhgorse
Copy link

jhgorse commented Jan 7, 2024

git clone + submodules
cmake -DCMAKE_BUILD_TYPE=Debug -DRC_ENABLE_TESTS=ON -DRC_ENABLE_EXAMPLES=ON -DRC_ENABLE_GTEST=ON -DRC_ENABLE_GMOCK=ON -DRC_ENABLE_BOOST=OFF -DRC_ENABLE_BOOST_TEST=OFF -DRC_ENABLE_RTTI=ON -G Ninja ..

[root:/tmp/rapidcheck/build] # ninja
[1/4] Building CXX object test/CMakeFiles/rapidcheck_tests.dir/main.cpp.o
FAILED: test/CMakeFiles/rapidcheck_tests.dir/main.cpp.o
/usr/bin/clang++-14  -I/tmp/rapidcheck/test/. -I/tmp/rapidcheck/test/../src -I/tmp/rapidcheck/include -I/tmp/rapidcheck/ext/catch/single_include -I/tmp/rapidcheck/extras/catch/include -Wall -Wno-missing-braces -Wno-unused-command-line-argument -g -std=gnu++11 -MD -MT test/CMakeFiles/rapidcheck_tests.dir/main.cpp.o -MF test/CMakeFiles/rapidcheck_tests.dir/main.cpp.o.d -o test/CMakeFiles/rapidcheck_tests.dir/main.cpp.o -c /tmp/rapidcheck/test/main.cpp
In file included from /tmp/rapidcheck/test/main.cpp:15:
/tmp/rapidcheck/ext/catch/single_include/catch2/catch.hpp:7972:34: error: constexpr variable 'sigStackSize' must be initialized by a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                 ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/rapidcheck/ext/catch/single_include/catch2/catch.hpp:7972:58: note: non-constexpr function 'sysconf' cannot be used in a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                                         ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:32:22: note: expanded from macro 'MINSIGSTKSZ'
# define MINSIGSTKSZ SIGSTKSZ
                     ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:28:19: note: expanded from macro 'SIGSTKSZ'
# define SIGSTKSZ sysconf (_SC_SIGSTKSZ)
                  ^
/usr/include/unistd.h:640:17: note: declared here
extern long int sysconf (int __name) __THROW;
                ^
In file included from /tmp/rapidcheck/test/main.cpp:15:
/tmp/rapidcheck/ext/catch/single_include/catch2/catch.hpp:8031:33: error: variable length array declaration not allowed at file scope
    char FatalConditionHandler::altStackMem[sigStackSize] = {};
                                ^           ~~~~~~~~~~~~
2 errors generated.
[2/4] Building CXX object extras/gmock/test/CMakeFiles/rapidcheck_gmock_tests.dir/main.cpp.o
FAILED: extras/gmock/test/CMakeFiles/rapidcheck_gmock_tests.dir/main.cpp.o
/usr/bin/clang++-14 -DCATCH_CONFIG_PREFIX_ALL -I/tmp/rapidcheck/extras/gmock/include -I/tmp/rapidcheck/include -I/tmp/rapidcheck/extras/catch/include -I/tmp/rapidcheck/ext/catch/single_include -isystem /tmp/rapidcheck/ext/googletest/googletest/include -isystem /tmp/rapidcheck/ext/googletest/googlemock/include -isystem /tmp/rapidcheck/ext/googletest/googlemock -isystem /tmp/rapidcheck/ext/googletest/googletest -Wall -Wno-missing-braces -Wno-unused-command-line-argument -g -MD -MT extras/gmock/test/CMakeFiles/rapidcheck_gmock_tests.dir/main.cpp.o -MF extras/gmock/test/CMakeFiles/rapidcheck_gmock_tests.dir/main.cpp.o.d -o extras/gmock/test/CMakeFiles/rapidcheck_gmock_tests.dir/main.cpp.o -c /tmp/rapidcheck/extras/gmock/test/main.cpp
In file included from /tmp/rapidcheck/extras/gmock/test/main.cpp:2:
/tmp/rapidcheck/ext/catch/single_include/catch2/catch.hpp:7972:34: error: constexpr variable 'sigStackSize' must be initialized by a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                 ^              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/rapidcheck/ext/catch/single_include/catch2/catch.hpp:7972:58: note: non-constexpr function 'sysconf' cannot be used in a constant expression
    constexpr static std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
                                                         ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:32:22: note: expanded from macro 'MINSIGSTKSZ'
# define MINSIGSTKSZ SIGSTKSZ
                     ^
/usr/include/x86_64-linux-gnu/bits/sigstksz.h:28:19: note: expanded from macro 'SIGSTKSZ'
# define SIGSTKSZ sysconf (_SC_SIGSTKSZ)
                  ^
/usr/include/unistd.h:640:17: note: declared here
extern long int sysconf (int __name) __THROW;
                ^
In file included from /tmp/rapidcheck/extras/gmock/test/main.cpp:2:
/tmp/rapidcheck/ext/catch/single_include/catch2/catch.hpp:8031:33: error: variable length array declaration not allowed at file scope
    char FatalConditionHandler::altStackMem[sigStackSize] = {};
                                ^           ~~~~~~~~~~~~
2 errors generated.
ninja: build stopped: subcommand failed.
@EJahren
Copy link

EJahren commented May 7, 2024

Seems like this can be fixed by upgrading the catch version to >v2.13.5: catchorg/Catch2#2421

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