On Tue, Oct 4, 2022 at 10:13 AM Rich Felker wrote: > If this is actually the case, it's disturbing that GCC does not seem > to be getting it right either... > The __sync_* builtins are legacy and were never particularly well-defined -- especially for non-x86 platforms. (Note that they don't include atomic load/store operations, which are effectively unnecessary on x86, but vital on most other architectures). I would suggest that musl (and anyone else) really ought to migrate from its homegrown atomics support to the standard C11 atomic memory model, which _is_ well-defined and extensively studied. Such a migration will certainly be a Project, of course...