4 ms·
> It should give you the maximum integer available How would you compile that to machine code which would, when run, still give you the maximum integer on next
by teddyh 4y ago
> It should give you the maximum integer available
How would you compile that to machine code which would, when run, still give you the maximum integer on next year’s CPU with all-new super-duper wide integers?
It is more reasonable to think of a binary to be compiled to a specific architecture triplet, and if the CPU changes, the architecture must change, and therefore the ABI, and if the OS wants to run a binary from an older architecture, some emulation layer is needed.
Of course, this would be a lot of work for the operating system people if they want to run binaries from lots of what are now different architectures, and it was apparently easier to just force the C standard to abandon the entire concept of intmax_t being the largest.
- thayne 4y ago> if the CPU changes, the architecture must change, and therefore the ABI That would add a lot of friction to changing CPUs, and making distributing software more complicated.
- dianeb 4y agoIn C, you get what you pay for. When the platform changes, it's not unreasonable to recompile in order to take advantage of new hardware features. The OS is certainly different, even if it's still called "Whatever OS", it had to be recompiled in order to support the new hardware, unless, of course, it doesn't. We're all lazy when it comes to our own work, whether it's supporting new hardware in a compiler or OS or super web service on some new cloud platform or a large system vendor. intmax_t by intent is the maximum integer available on a given platform. Abandoning that idea is a disservice to compiler writers, programmers -- especially scientific programmers -- everywhere.
- teddyh 4y agoOh, I agree completely. Distributions should have bit the bullet and announced a new architecture when the new CPUs with new integer types were released.