Skip to content

swift-atomics uses non-standard _Atomic(bool) operations #37

@lorentey

Description

@lorentey

Swift Atomics currently exposes and/xor/or operations on booleans, and maps them to atomic_fetch_XXX_explicit calls in C. However, C17 does not define these operations on _Atomic(_Bool); it only defines them for other atomic integer types.

This is silently accepted by Clang, but it causes build issues when the _AtomicsShims module is compiled with GCC, such as with CMake.

Review Bool's atomic operations and figure out if we should deprecate loadThenLogicalOr and friends, or if we can continue exposing them (with this implementation or through compareExchange).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions