-
Notifications
You must be signed in to change notification settings - Fork 17.2k
__c11_atomic_add_fetch is not implemented #133697
Copy link
Copy link
Closed as not planned
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featureextension:clangwontfixIssue is real, but we can't or won't fix it. Not invalidIssue is real, but we can't or won't fix it. Not invalid
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featureextension:clangwontfixIssue is real, but we can't or won't fix it. Not invalidIssue is real, but we can't or won't fix it. Not invalid
Type
Fields
Give feedbackNo fields configured for Feature.
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) *') invalidAfter 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)