Bug 24141 – ImportC: C11 atomics not supported

Status
NEW
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-09-12T06:22:38Z
Last change time
2024-12-13T19:30:44Z
Keywords
ImportC
Assigned to
No Owner
Creator
Walter Bright
See also
https://issues.dlang.org/show_bug.cgi?id=23770
Moved to GitHub: dmd#18185 →

Comments

Comment #0 by bugzilla — 2023-09-12T06:22:38Z
Reported by Jeffrey H. Johnson: it seems one cannot use C11 atomics. I don't know if this is something that can be worked around, but if you try to use them, you get the following error messages from DMD: file.c(99): Error: undefined identifier `__c11_atomic_load` file.c(126): Error: undefined identifier `__c11_atomic_store` file.c(204): Error: undefined identifier `__c11_atomic_store` file.c(220): Error: undefined identifier `__c11_atomic_load` file.c(429): Error: undefined identifier `__c11_atomic_init`
Comment #1 by bugzilla — 2023-09-12T06:25:24Z
Atomics are optional in C11, but ImportC should support them anyway.
Comment #2 by alphaglosined — 2023-09-12T06:26:17Z
There appears to be a define that disables them: https://en.cppreference.com/w/c/atomic However, dmd should bite the bullet and finally implement the atomic intrinsics. They are long overdue and I've had so many issues with them not being an intrinsic in D as well.
Comment #3 by bugzilla — 2023-09-12T06:27:24Z
I know.
Comment #4 by robert.schadek — 2024-12-13T19:30:44Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18185 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB