Hacker News new | ask | show | jobs
by eps 884 days ago
C23 is scheduled to promote bool, alignof & co. to keywords, so the concern for using _Xxx keywords is recognized by the committee. They introduce _Xxx keywords, sometimes alias them to lowercase versions with macros and let this age. Then, some time after, they switch to the "primary spelling", which is how the lowercase versions are referred to.

You can't easily lowercase _Type and _Var, so practically speaking it will take years before these features could be suitable for wide-spread adoption. Hence my original comment - given the friction, is it worth expanding the language this way at all then?

1 comments

_Bool etc. came with convenience macros defined from <stdbool.h> and so on, but _Generic never did, suggesting that the underscored version was meant to stay forever that way. (Otherwise it should have been named as something like _Generic_switch and later renamed to generic_switch...) Maybe _Type and _Var are similarily intended.
I mean, _Generic is usually hidden behind a macro anyways, so it doesn't really show up in you text file all that much.