cppcoro icon indicating copy to clipboard operation
cppcoro copied to clipboard

Doctest included in the project is no longer compatible with newer glibc

Open gnaggnoyil opened this issue 1 year ago • 0 comments

Starting from glibc 2.34 the value SIGSTKSZ turned from a compile-time constant to a run-time value, which is incompatible with the current doctest.h this project is using. Thus, on platforms that use newer glibc, running cake with tests enabled will fail during build time.

On my Archlinux system, I tried following the build instructions described in README.md, and the command cake gave me the following error:

In file included from test/main.cpp:7:
test/doctest/doctest.h:4518:28: error: variable length array declaration not allowed at file scope
                        static char             altStackMem[SIGSTKSZ];
                                                ^           ~~~~~~~~
test/doctest/doctest.h:4568:34: error: variable length array declaration not allowed at file scope
                char    FatalConditionHandler::altStackMem[SIGSTKSZ] = {};

FYI, as of today(2022-09-13), glibc version on Archlinux is 2.36 and clang version is 14.0.6.

The doctest upstream has an issue discussing about the incompatibility, and it seems newer releases of doctest had already fixed it.

gnaggnoyil avatar Sep 13 '22 07:09 gnaggnoyil