3 ms·
> but just a macro of an int value like it is now in C. That's not the case for the last couple of decades (I think since C99?). The underlying type of bool wh
by flohofwoe 2y ago
> but just a macro of an int value like it is now in C.
That's not the case for the last couple of decades (I think since C99?). The underlying type of bool which is defined in stdbool.h is _Bool, which is a "proper" builtin boolean type. The type wrapping in a header is just there to not break existing code which had its own 'bool' typedef. AFAIK in C23, bool is a regular keyword now though.
- bhaak 2y agoThe proper support is still very limited. You can still do "bool b = 10" or "int i = true". C being C ("everything is an int") this will be coerced to 1.