Re:C23 is finished: Here is what is on the menu
by kevin_thibedeau on Friday August 05, 2022 @05:40PM
(#32362285)
Because it isn't "64-bits on x64". It's 32-bit minimum on all platforms. Assuming larger sizes than the minimum is how brittle code gets written. A compiler vendor can set the sizes to whatever they want regardless of the target architecture and claim conformance if they meet the minimum.
[ Parent
| on HN ]
Re:C23 is finished: Here is what is on the menu
by klodolph on Friday August 05, 2022 @09:44PM
(#32364019)
Talking about the SysV ABI. There are multiple standards involved, not just the language standard itself.
> A compiler vendor can set the sizes to whatever they want regardless of the target architecture and claim conformance if they meet the minimum.
Compilers claim conformance with other standards besides just the C standard.
Re:C23 is finished: Here is what is on the menu
by bjourne on Saturday August 06, 2022 @04:53AM
(#32366286)
You are confusing ABIs with what the C standards mandate. A compiler emitting code for a particular architecture need to conform to that architecture's ABI. Or else it won't be able to interface with syscalls or other libraries. This goes for other things too like calling conventions and setup of stack frames. As klodolph states, long is 64 bit on x86_64, (32 on x86_64-win) and 32 on x86.