blink
blink copied to clipboard
error: address argument to atomic operation must be a pointer to non-const _Atomic type
blink 1.0.0 fails to build on older versions of macOS using older versions of Apple Clang (older than 1001):
./blink/jit.h:270:10: error: address argument to atomic operation must be a pointer to non-const _Atomic type ('const _Atomic(bool) *' invalid)
return atomic_load_explicit(&jit->disabled, memory_order_acquire);
^ ~~~~~~~~~~~~~~
I reported this to MacPorts as well.
There's more background in a similar PHP bug report.
It seems that C11 defined this to be non-const
, and C17 fixed it to be const
, and Apple Clang 1001 and later will also allow it to be const
even in C11 mode.
Your README says you support C11 compilers:
https://github.com/jart/blink/blob/a00feef713edc4d586fb41da30e40c22ad3641ce/README.md?plain=1#L48
My suggested solutions are that you either cast away the const
ness so that you are actually compatible with all C11 compilers, or you indicate that you require a C17 compiler.