Adding a new keyword that might break existing code? Meh. We have good tools for search/replace nowadays. Hope they go the route of a normal looking keyword, not the whole _Bool and other class of nastiness.
I think _Bool with stdbool.h giving you bool alias as actually fine for all practical purposes. I love the idea of putting all these opt-in headers into single stdc25.h, though.
My main issue is that there’s just more preprocessor involved for what should be intrinsic keywords, IMO. That’s also an extra file that needs to be opened and parsed, etc.
You are not wrong. Having the keyword enable by opting-in via compiler configuration would also be viable. Haskell does it, so why not GCC/LLVM/…? But still, Haskell also allows one to opt-in on a per-file basis. I guess C compilers could do it that way as well.
#pragma standard c25
But it’s probably not a sane idea to just add a reserved keyword.
there’s just more preprocessor involved … also an extra file that needs to be opened and parsed, etc.
Is this actually required? From a position of naivety w.r.t. the details of how C works, I would think that #include <stdc25.h> and #pragma standard c25 both would admit the same implementations: a toolchain could recognize #include <stdc25.h> and treat it specially with logic built into the toolchain (no file reading) rather than encoded into the standard library (yes file reading), and #pragma standard c25 could be implemented by logic built into the toolchain (no file reading) or loaded as some plugin (yes file reading).
Adding a new keyword that might break existing code? Meh. We have good tools for search/replace nowadays. Hope they go the route of a normal looking keyword, not the whole
_Booland other class of nastiness.I think
_Boolwithstdbool.hgiving youboolalias as actually fine for all practical purposes. I love the idea of putting all these opt-in headers into singlestdc25.h, though.C23 makes the
boolmacro predefined, so you don’t need the header anyway.My main issue is that there’s just more preprocessor involved for what should be intrinsic keywords, IMO. That’s also an extra file that needs to be opened and parsed, etc.
But everyone has an opinion ;-)
You are not wrong. Having the keyword enable by opting-in via compiler configuration would also be viable. Haskell does it, so why not GCC/LLVM/…? But still, Haskell also allows one to opt-in on a per-file basis. I guess C compilers could do it that way as well.
But it’s probably not a sane idea to just add a reserved keyword.
Is this actually required? From a position of naivety w.r.t. the details of how C works, I would think that
#include <stdc25.h>and#pragma standard c25both would admit the same implementations: a toolchain could recognize#include <stdc25.h>and treat it specially with logic built into the toolchain (no file reading) rather than encoded into the standard library (yes file reading), and#pragma standard c25could be implemented by logic built into the toolchain (no file reading) or loaded as some plugin (yes file reading).