So one side effect of C being a mess is that bool and char constants are formatted as integers by default. You have to either cast them to the correct type or use an explicit format specifier which is a bit annoying.
@thradams@vitaut _Bool goes all the way back to C99, C23 actually deprecated it in favour of 'bool' (eg. stdbool.h no longer needed), both are "proper" bools, but AFAIK the C standard doesn't enforce a specific size
@thradams@vitaut also I suspect that the problem might be that _Bool/bool implicitly converts to int (eg I guess in vararg lists, bools are passed as int, not sure though)
@floooh@vitaut@thradams if you’re compiling as standard C99 or C11, it is “right” for true and false to be ints, since they are specified to be #define-d as 1 and 0 in stdbool.h
@floooh@vitaut@thradams the other annoying thing is that the comparison operators also all produce results of type `int` in C. I forget whether c23 fixes that as well
@joe@vitaut@thradams ...and then the next problem is that MSVC will probably never get C23 support (they should just be honest and declare MSVC as deprecated and switch Visual Studio to Clang as default compiler)
Yeah, we should just change this. But a compiler maintainer or some company sitting on legacy code that it wants remain conforming without maintenance effort will likely complain.
@uecker@vitaut@thradams@foonathan@floooh@JensGustedt it seems like wg14 is more willing now to accept lightly-breaking changes like new keywords. would this be the sort of change you all would accept under a new language version?
@joe@vitaut@thradams@foonathan@floooh@JensGustedt Unclear. I try sometimes but some compiler vendors often protest vehemently against such changes. For example, I wanted to make null pointer constants have pointer types (which is a much more serious issue than this boolean issue), but there was a lot of opposition.