Repository navigation
crypto: the test support includes <mm_malloc.h> before its replaced C allocation functions - #21
Merged
Merged
Conversation
… allocation functions Clang's <mm_malloc.h>, which the x86 intrinsic headers include (Boost.URL's and Boost.JSON's <emmintrin.h>), 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).
pinhopro
pushed a commit
to webcpporg/webcpp
that referenced
this pull request
Dec 3, 2026
…ix branches webcpporg/codecs#2, webcpporg/crypto#21, webcpporg/hash#18 and webcpporg/secure#2: the test support includes <mm_malloc.h> before its replaced C allocation functions (Clang on x86_64 Linux), and codecs' dudect base58 cases prepare by the constant-time conversion. Moved to their merges once they are merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every test that includes
test/support/counting.hppand then a header that includes the x86 intrinsics failed to compile with Clang on x86_64 Linux:Clang's
<mm_malloc.h>(from<emmintrin.h>, which Boost.URL and Boost.JSON include on x86) redeclaresposix_memalignwithout an exception specification. Clang accepts that only when the declaration before it is a system header's (glibc's,__THROW); after the test support'snoexceptreplacement it is an error. GCC's<mm_malloc.h>declares itthrow (), and arm64 never includes it, so only the Clang lanes on x86_64 Linux saw it: on webcpp's main (run 46916884991) the Clang 18 and Clang 22 lanes failed to compile codecs' percent tests and crypto's formats tests, and the CI lint's clang-tidy (wasi-sdk's Clang 23, with the host target) failed shards 1, 4, 6, 7, 9 and 10. The macOS and arm64 Linux lints could not see it.The fix: the glibc branch of the test support includes
<mm_malloc.h>(when the compiler has it) before the replacements, so its redeclaration follows glibc's.Reproduced and verified on x86_64 Linux (Docker, clang++-18): codecs' percent_test.cpp and allocation_percent_test.cpp failed with that error before and compile after; the Linux lint (amd64) on the affected units.
The same change is made to the copies in secure, hash, crypto and codecs; in this library it is latent or failing as follows: failing (formats_ed25519_sodium, formats_x25519_sodium, p256_formats_bearssl, secp256k1_formats).
🤖 Generated with Claude Code