3 ms·
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 ven
by kevin_thibedeau 4y ago
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.
- klodolph 4y agoTalking 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.
- bjourne 4y agoYou 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.