-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support _Atomic in translate-c #11415
Comments
The problem is that This is fine on x86 and some CPU architectures where load/store of register-sized integer is always atomic, but what problem will C non-compilance cause down the road? Should we even care about this? Maybe generate compile-time warnings is fine. |
Partially related #4248 |
Probably related #5101 |
This affects Nuitka (the Python compiler) and Python 3.11 or higher. We as a project want to use zig as a backend C compiler, with long term hope of being able to use it exclusively. I am commenting here more follow. Writing a compiler myself, I know how hard this issue can be to solve for you, seeing a 0.15 milestone probably means, this will take a while. Nuitka requires C11 more or less with modern Python. |
_Atomic
data types are available in C11 that ensures atomic read and load. I'm not sure how to implement this in Zig.Zig Version
0.10.0-dev.1427+ad5770eba
Steps to Reproduce
Save the text below as
test.c
:Then run
zig translate-c test.c
.Expected Behavior
No error
Actual Behavior
The text was updated successfully, but these errors were encountered: