4 ms·
Are there any example of how big projects deal with this? Like, using int64_t and friends. I'm also surprised that there does not seem to be an option to tell
by pepijndevos 10y ago
Are there any example of how big projects deal with this? Like, using int64_t and friends.
I'm also surprised that there does not seem to be an option to tell GCC to use 64 bit ints if this really produces better code.
https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/i386-and-x86_002d64-Options.html https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/i386-and-x86_00...
- GlitchMr 10y agoIf you could change meaning of int to be 64-bit type, then your code ABI (https://en.wikipedia.org/wiki/Application_binary_interface https://en.wikipedia.org/wiki/Application_binary_interface) would be essentially incompatible, and you wouldn't be able to use code (such as standard library, or other headers provided by operating system libraries) that was compiled on a compiler where int was 32-bit, as for instance wrong structure fields would be read. If you would try to "solve" that by assuming headers use 32-bit int definition, then you would break calling your own code, as you would use 32-bit int definition provided in headers, while your code was called with 64-bit int convention. It's probably just easier to define your own int meaning type, say, a shorter alias of int_fast32_t.
- deleted 10y ago[deleted]