Fix boolean typedef for C23#1722
Conversation
The C23 standard elevates "false" and "true" to keywords, making it illegal to use them as enum variant names. This commit makes the code use the built-in "bool" type when building with C23 or later.
|
Do we want this or do we want to set the C standard to 89? |
|
That's another possibility - neither CMake nor autotools seem to set the C standard anywhere, so the engine gets built with whatever is the compiler's default. I came across this while rebuilding the Footnotes |
|
I believe current GCC and Clang releases default to the C11 standard (with extensions), that's probably the safe baseline for Chocolate Doom. C23 reserving |
C89 won't work because |
GCC 15 will be released this year and will default to C23, which will require a whole new order of magnitude of code changes to properly support it.
Yes, right. We already use C99 features in the code, so the right thing to do will be to declare our code as C99 compliant and require a compatible compiler. While at it, when declaring as C99 compliant, we may unconditionally include the I'm going to prepare a PR now. |
At least this is what I had to do to properly compile Woof with gcc-15. No idea why Chocolate gets away with only this one change here. |
|
I suspect it's because chocolate uses |
The C23 standard elevates "false" and "true" to keywords, making it illegal to use them as enum variant names. This commit makes the code use the built-in "bool" type when building with C23 or later.