News for hackers. Stuff that matters.
Re:C23 is finished: Here is what is on the menu by kazinator on Friday August 05, 2022 @10:16AM (#32356409)
intmax_t can rationally be regarded as being outside of the ABI concept. It should give you the maximum integer available, not the maximum integer that your compiler had 15 years ago for the sake of compatibility.

Anyone who uses intmax_t in a durable API (public function argument, member of public structure) is just a goof.

Re:C23 is finished: Here is what is on the menu by teddyh on Friday August 05, 2022 @12:45PM (#32358620)
> 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.

Re:C23 is finished: Here is what is on the menu by dianeb on Friday August 05, 2022 @01:31PM (#32359217)
In 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.

Re:C23 is finished: Here is what is on the menu by teddyh on Friday August 05, 2022 @03:15PM (#32360646)
Oh, I agree completely. Distributions should have bit the bullet and announced a new architecture when the new CPUs with new integer types were released.
Re:C23 is finished: Here is what is on the menu by thayne on Saturday August 06, 2022 @01:00AM (#32364962)
> 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.

Re:C23 is finished: Here is what is on the menu by eropple on Friday August 05, 2022 @10:40AM (#32356779)
Lotta goofs write a lotta code, though. I'm not sure that I disagree with you, but this feels like the sort of thing that could really hurt to break.
Re:C23 is finished: Here is what is on the menu by dodobirdlord on Friday August 05, 2022 @12:57PM (#32358783)
There are a lot of goofs out there running goofy binaries for which they have lost the goofy source code. These people are unfortunately also the committee’s problem.