-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Missing c_float and c_double types #3999
Comments
I'd have to double check, but I believe I found in the C spec that it defines I agree that the docs or at the very least FAQ should be updated with an explanation of this. |
From K&R The C Programming Language A.4.2:
For example in avr-gcc Also according to the rust documentation for c_float:
|
Also |
@shawnl there's a related issue for |
To make this a bit more concrete: RX microcontrollers (which are still in use and have maintained GCC and QEMU ports) have Edit: The same is true for RL78 microcontrollers. The GCC port for RL78 was added in 2011. There are also older architectures like VAX and PDP-11 that have weird, non-IEEE float formats, but I don't know if Zig needs to care about those. These architectures are more or less dead, and it doesn't seem to be popular to create non-IEEE float formats anymore. |
@andrewrk just for the record, I'm volunteering to do the implementation work for this feature if approved. |
Zig doesn't provide
c_float
andc_double
types. C doesn't fully guarantee how thefloat
anddouble
types are implemented, so shouldn't zig provide types for them instead of relying onf32
andf64
? If there is a reason for why they are omitted, it should probably be added to the documentation about floats and C interop.The text was updated successfully, but these errors were encountered: