Open
Description
Could you please implement the missing C11 variants of the atomic builtins?
I was using stdatomic.h in my code, sometimes directly with the __atomic_*
builtins, but got a quite confusing compilation error:
address argument to atomic operation must be a pointer to integer, pointer or supported floating point type ('atomic_uint *' (aka '_Atomic(unsigned int) *') invalid
After doing some search it turned out that instead of the __atomic_*
builtins the __c11_atomic_*
builtins shall be used. It fixed most of my issues except where a __c11_*
variant is not available.
While those are not available, it it OK to make the compilation error go away by casting the atomic pointer to ordinary pointer?
__atomic_add_fetch((unsigned int *)(ptr), val, memorder)