https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119170
--- Comment #13 from Alejandro Colomar <alx at kernel dot org> --- (In reply to Kang-Che Sung from comment #12) > As the width of these types can be retrieved via the `sizeof(T) * CHAR_BIT` > fallback, I said the `_Widthof` operator on these types is not a > "necessity". That leaves only the bit width of `_BitInt(N)` being the > primary reason of introducing the operator. Yes. > I'm not saying that `_Minof` and `_Maxof` are useless. It just occurs to me > that there is no strong reason for standardizing them as keywords, comparing > to usual idioms. (I would say I stand for the motto of "if it ain't broke, > don't fix it".) > [...] > > Unimportant differences, I would say. Not really unimportant. Every time someone writes one of these in a project, you need to make sure it's correct, and reviewing it isn't easy. And if it has small differences with another version of it, I need to review those very carefully. > > > I have multiple concerns with the `_Minof` and `_Maxof` proposal > > > currently: > > > * There are not technically necessary, and when programs need them, they > > > are > > > trivially implementable. (Standardizing them as keywords would only > > > introduce noise to the language.) > > > > I wouldn't call the above trivial. > > The programmer who had to review my implementation certainly didn't feel > > safe: > > <https://github.com/shadow-maint/shadow/pull/896#discussion_r1659894055> > > Unfortunately this doesn't convince me. > > I know your position - you want this to be available as a compiler builtin, > and I support that. However, there are many code out there that aim for > older versions of the standard, thus pushing this into C2x would not, > AFAICT, solve the concerns of other programmers when the macro code needs a > fallback (for pre-C2x compilers). 20 years from now, when all compilers support _Minof/_Maxof, people will be happy that we did this. Otherwise, they'll keep writing their own stuff. The same could've been said of _Bool back then, and we can now use it to make our booleans simpler and safer. Or with many other features. Some programs will be able to use them sooner, others later. With my macro definition of MAXOF(), you get 6 expansions of the argument. When you nest many levels of macros, you certainly want to reduce that, or it soon grows exponentially. This would help that. > > I would say making `_Maxof` a compiler built-in does not require the keyword > to be standardized, and sometime it would be better for this built-in to be > left as an extension, not mandatory for an implementation. I would be happy with it being an extension, but I think no compiler will be against standardizing it, at which point it's easier to just standardize it.