C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Don't get rid of <stdbool.h>

From: Alejandro Colomar <une+cxx_std-proposals_at_[hidden]>
Date: Mon, 23 Nov 2026 22:43:15 +0100
Hi,

> Date: 2026-11-23 16:34:01-0500
> From: Halalaluyafail3 via Std-Proposals <std-proposals_at_[hidden]>
>
> <stdbool.h> and <stdalign.h> are not deprecated in C.

Indeed. And even if they were, they'd be not removed, so the
preprocessor conditional would be unnecessary. Only when/if they were
removed, those'd be necessary.

> The only header
> which is obsolescent in C is <stdnoreturn.h>, and that is because
> instead of making a noreturn keyword it was decided to make noreturn
> an attribute like C++.

And we're now having doubts about that attribute, so perhaps
<stdnoreturn.h> might come back. :)


Have a lovely night!
Alex

>
> On Mon, Nov 23, 2026 at 4:11 PM Frederick Virchanza Gotham via
> Std-Proposals <std-proposals_at_[hidden]> wrote:
> >
> >
> > I don't know if there are plans to deprecate <stdbool.h> and <stdalign.h> now that they have been replaced with keywords in C, but I'd just like to say that I think that they should be kept forever in both C and C++, especially because there's such wide variety in what standards of C are used (some still on C89).
> >
> > It's nice to be able to write a header file as follows:
> >
> > #include <stdbool.h>
> > extern bool Init(void);
> >
> > instead of having to do:
> >
> > #ifndef __cplusplus
> > # include <stdbool.h>
> > #endif
> > extern bool Init(void);
> >
> > I think it was a mistake for them to deprecate these headers in C23, because now we have to do:
> >
> > #if !__cplusplus && __STDC_VERSION__ < 202311l
> > # include <stdbool.h>
> > #endif
> > extern bool Init(void);
> >
> > I think C should on undeprecate these headers, and I think C++ should never deprecate them.
> > --
> > Std-Proposals mailing list
> > Std-Proposals_at_[hidden]
> > https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

-- 
<https://www.alejandro-colomar.es>

Received on 2026-11-23 21:43:25