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

MINSIGSTKSZ cannot be used for constexpr variable #52

Open
slinkinone opened this issue Jan 25, 2023 · 2 comments
Open

MINSIGSTKSZ cannot be used for constexpr variable #52

slinkinone opened this issue Jan 25, 2023 · 2 comments

Comments

@slinkinone
Copy link

Error description

[1/4] Building CXX object test/CMakeFiles/catch_main.dir/catch_main.cpp.o
FAILED: test/CMakeFiles/catch_main.dir/catch_main.cpp.o 
/usr/bin/g++   -Wall -Wextra -pedantic -O3 -DNDEBUG -std=c++11 -MD -MT test/CMakeFiles/catch_main.dir/catch_main.cpp.o -MF test/CMakeFiles/catch_main.dir/catch_main.cpp.o.d -o test/CMakeFiles/catch_main.dir/catch_main.cpp.o -c /home/user/github/span/test/catch_main.cpp
In file included from /usr/include/signal.h:328,
                 from /home/user/github/span/test/catch.hpp:7712,
                 from /home/user/github/span/test/catch_main.cpp:3:
/home/user/github/span/test/catch.hpp:10453:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10453 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /home/user/github/span/test/catch.hpp:7712,
                 from /home/user/github/span/test/catch_main.cpp:3:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /home/user/github/span/test/catch_main.cpp:3:
/home/user/github/span/test/catch.hpp:10512:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10512 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~
ninja: build stopped: subcommand failed.

Compiling information

g++ --version
g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.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.
ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35
Copyright (C) 2022 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.
Written by Roland McGrath and Ulrich Drepper.


Hotfix

catch.hpp:

...
#elif defined ( CATCH_CONFIG_POSIX_SIGNALS )

#include <signal.h>

#undef MINSIGSTKSZ
#define MINSIGSTKSZ 16384

namespace Catch {
...

Useful links

@kimci86
Copy link
Contributor

kimci86 commented Jan 25, 2023

This can be solved by updating catch header. The pull request #51 doing so is ready.

@slinkinone
Copy link
Author

@kimci86 Agree. Thanks! I've checked and it has been compiled. I really hope it will be merged in the nearest future.

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