From d444f05a5e6b9a3c21d7d8ce5af883e6ec0e5b81 Mon Sep 17 00:00:00 2001 From: R Date: Wed, 2 Dec 2026 21:44:43 -0300 Subject: [PATCH] secure: the test support includes before its replaced C allocation functions Clang's , which the x86 intrinsic headers include (Boost.URL's and Boost.JSON's ), redeclares posix_memalign without an exception specification. Clang accepts that only after a system header's declaration; after the test support's noexcept replacement it is an error, so every test that includes counting.hpp and then such a Boost header failed to compile with Clang on x86_64 Linux (the Clang 18 and Clang 22 lanes and the CI lint). --- test/support/counting.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/support/counting.hpp b/test/support/counting.hpp index d0fbaa3..56ef3b7 100644 --- a/test/support/counting.hpp +++ b/test/support/counting.hpp @@ -243,6 +243,14 @@ void __libc_free(void*); #define WEBCPP_TEST_C(name) __libc_##name // glibc declares these with __THROW, noexcept in C++11 and later: a replacement must match. #define WEBCPP_TEST_C_NOEXCEPT noexcept +// Clang's , which the x86 intrinsic headers include (, included by +// Boost.URL and Boost.JSON among others), redeclares posix_memalign without an exception +// specification. Clang accepts that redeclaration only when the declaration before it is a +// system header's (glibc's), so comes before the replacement below: included after +// it, it fails to compile ("'posix_memalign' is missing exception specification"). +#if __has_include() +#include +#endif #else #define WEBCPP_TEST_C(name) emscripten_builtin_##name // Emscripten's musl declares them without an exception specification.