Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: address argument to atomic operation must be a pointer to non-const _Atomic type #148

Open
ryandesign opened this issue Aug 2, 2023 · 0 comments

Comments

@ryandesign
Copy link

ryandesign commented Aug 2, 2023

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:

- A C11 compiler with atomics (e.g. GCC 4.9.4+)

My suggested solutions are that you either cast away the constness so that you are actually compatible with all C11 compilers, or you indicate that you require a C17 compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant