Re:C23 is finished: Here is what is on the menu
by teddyh on Friday August 05, 2022 @06:07AM
(#32353963)
You may be right that it’s the best solution. It’s horrible to contemplate, but it might be so.
[ Parent
| on HN ]
Re:C23 is finished: Here is what is on the menu
by jcranmer on Friday August 05, 2022 @09:57AM
(#32356172)
The best solution is to say that uid_t et al are probably no larger than uint64_t, and introducing a static_assert that makes sure that the compiler will fail if it's not.
Sure, someone might come up with an architecture where that's not true. But even in an intmax_t-is-really-the-largest-integer-type world [which hasn't been true for the major C compilers for the past decade or so!], I can almost assuredly come up with some compilation modes that still conform with whichever C version you use that still causes your code to fail horribly. I don't think there's any architecture where uid_t et al would exceed uint64_t, and until such an architecture comes to exist, it's quite frankly not worth caring about.