Suppress -Wincompatible-pointer-types when needed - #397
Conversation
|
Hey! I added macOS 26 (both on arm and x86) to the CI matrix: #398. It seems to compile just fine, even without your change… 🤔 The images use clang 17, according to https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md. Maybe there is another cause for the compilation issues? EDIT: The referenced issues mention this problem also happening on older macOS versions, not only macOS 26. |
LLVM Clang 22+ treats -Wincompatible-pointer-types as an error by default, which breaks compilation of mini_racer_extension.c due to the unsigned long vs uint64_t mismatch in the bigint serialization code. Add -Wno-incompatible-pointer-types to CFLAGS when the compiler rejects an unsigned long to uint64_t pointer conversion, as a workaround until the type mismatch is properly fixed in the extension source. Ref: rubyjs#359 Ref: rubyjs#361
|
@tisba Sorry, the build process picked Clang 22 installed via Homebrew, which was the cause. I've updated the fix. |
|
Thank you. This greatly exceeds my level of expertise though 😅 Maybe @SamSaffron @bnoordhuis can take a look? |
|
The added conditional basically checks if the compiler accepts |
|
Wouldn't this also solve the issue? diff --git a/ext/mini_racer_extension/serde.c b/ext/mini_racer_extension/serde.c
index 7d5d51f..3a3d8eb 100644
--- a/ext/mini_racer_extension/serde.c
+++ b/ext/mini_racer_extension/serde.c
@@ -244,7 +244,7 @@ static void ser_num(Ser *s, double v)
}
// ser_bigint: |n| is in bytes, not quadwords
-static void ser_bigint(Ser *s, const uint64_t *p, size_t n, int sign)
+static void ser_bigint(Ser *s, const unsigned long *p, size_t n, int sign)
{
if (*s->err)
return; |
|
@bnoordhuis It doesn't. % clang++ --version
Homebrew clang version 22.1.2
Target: arm64-apple-darwin25.4.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/22.1.2/bin
Configuration file: /opt/homebrew/Cellar/llvm/22.1.2/etc/clang/arm64-apple-darwin25.cfg |
|
Does this work? I think it resolves it without hacking compile - cc @bnoordhuis |
|
merged my pr I think we compile fine now |
|
Has a new version to address this already released? |
as far as I can tell, not yet. Might be an oversight /cc @SamSaffron |
|
yes I think so. it should released. |
|
554923f is not in the v0.22.0 tag ( v0.22.0...main) |
|
oh ... let me do a release.
…On Thu, Aug 27, 2026 at 4:49 PM Sebastian Cohnen ***@***.***> wrote:
*tisba* left a comment (rubyjs/mini_racer#397)
<#397 (comment)>
554923f
<554923f>
is not in the v0.22.0 tag ( v0.22.0...main
<v0.22.0...main>)
—
Reply to this email directly, view it on GitHub
<#397?email_source=notifications&email_token=AAABIXLAH7NRCSAFIW52MN35L7KV5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBTGUZTSNRWGY32M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5435396667>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABIXLLUWJJ6KTOBIUONSL5L7KV5AVCNFSNUABEKJSXA33TNF2G64TZHM2TQMBSHE3TKNJ3JFZXG5LFHM2DAMZYGIZDOMJQGOQXMAQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
LLVM Clang 22+ treats -Wincompatible-pointer-types as an error by default, which breaks compilation of mini_racer_extension.c due to the unsigned long vs uint64_t mismatch in the bigint serialization code.
Add -Wno-incompatible-pointer-types to CFLAGS when the compiler rejects an unsigned long to uint64_t pointer conversion, as a workaround until the type mismatch is properly fixed in the extension source.
Ref: #359
Ref: #361