[RFC v2 1/3] cdefs: Add __bool
Collin Funk
collin.funk1@gmail.com
Tue Sep 2 15:06:23 GMT 2025
Alejandro Colomar <alx@kernel.org> writes:
>> Hmmmm, true. Can we drop support for compilers that don't have
>> _Bool/bool? That would be the easiest thing to do:
>>
>> #if defined __cplusplus
>> # define __bool bool
>> #else
>> # define __bool _Bool
>> #endif
>
> Self-reply:
>
> This seems entirely possible, given the glibc documentation requires
> GCC 12.1 at least.
> <https://sourceware.org/glibc/manual/latest/html_node/Tools-for-Compilation.html>
We shouldn't use _Bool in C23 since compilers are free to stop
supporting it at any time. You can use the expression
"202311L <= __STDC_VERSION__".
Collin
More information about the Libc-alpha
mailing list