[RFC v2 1/3] cdefs: Add __bool
Alejandro Colomar
alx@kernel.org
Tue Sep 2 15:32:44 GMT 2025
Hi Collin,
On Tue, Sep 02, 2025 at 08:06:23AM -0700, Collin Funk wrote:
> 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__".
They're not. C2y still specifies _Bool as mandatory.
<https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3550.pdf#table.0.6.1>
They're obsolescent, but their dawn hasn't come yet.
The standard says:
These [alternative spellings] can be used wherever the keyword can.
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250902/1f7e6e51/attachment-0001.sig>
More information about the Libc-alpha
mailing list