[PATCH v2] ginclude: Add comments to <stdalign.h> and <stdbool.h> about deprecated macros
Jason Merrill
jason@redhat.com
Tue Sep 29 15:19:24 GMT 2026
On 9/29/26 7:19 AM, Jonathan Wakely wrote:
> On Fri, 25 Sept 2026 at 18:18, Jason Merrill wrote:
>> While we're touching the comments, how about mentioning the C23 changes
>> as well?
>
> Good idea. Like so?
OK.
> -- >8 --
>
> The <stdalign.h> macros were removed from C23 and C++26 but this patch
> just tweaks the comment, without actually removing them. Doing so would
> technically be a breaking change, but it's not expected that these
> macros are widely used.
>
> gcc/ChangeLog:
>
> * ginclude/stdalign.h (__alignas_is_defined, __alignof_is_defined):
> Note that the macros were removed in C23 and C++26.
> * ginclude/stdbool.h (__bool_true_false_are_defined): Note that
> the macro is obsolescent since C23 and deprecated since C++23.
> ---
> gcc/ginclude/stdalign.h | 3 ++-
> gcc/ginclude/stdbool.h | 2 ++
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/ginclude/stdalign.h b/gcc/ginclude/stdalign.h
> index a68cb28059ce..fdf016ef3bfe 100644
> --- a/gcc/ginclude/stdalign.h
> +++ b/gcc/ginclude/stdalign.h
> @@ -33,7 +33,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
> #define alignof _Alignof
> #endif
>
> -/* These are defined for C++, but deprecated in C++23. */
> +/* Added in C99, removed in C23.
> + Also defined in C++ since C++11, deprecated in C++23 and gone in C++26. */
> #define __alignas_is_defined 1
> #define __alignof_is_defined 1
>
> diff --git a/gcc/ginclude/stdbool.h b/gcc/ginclude/stdbool.h
> index 9070a1876233..a45bd9b7712b 100644
> --- a/gcc/ginclude/stdbool.h
> +++ b/gcc/ginclude/stdbool.h
> @@ -46,6 +46,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
> #endif /* __cplusplus */
>
> /* Signal that all the definitions are present. */
> +/* Added in C99, made obsolescent in C23.
> + Also defined in C++ since C++11, but deprecated in C++23. */
> #define __bool_true_false_are_defined 1
>
> #endif /* stdbool.h */
More information about the Libstdc++
mailing list