git: 75b635c77443 - main - cdefs: update for C23 and POSIX24

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 15 Nov 2024 02:02:12 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=75b635c774436d6ced8113e04dadbd5b859fea42

commit 75b635c774436d6ced8113e04dadbd5b859fea42
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-11-14 23:52:56 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-11-15 02:01:12 +0000

    cdefs: update for C23 and POSIX24
    
    Also tweak a few placs where we can now use macros for C23 and POSIX24.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D47580
---
 share/man/man9/cdefs.9 | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9
index 3d1f6159bc60..38762c22f586 100644
--- a/share/man/man9/cdefs.9
+++ b/share/man/man9/cdefs.9
@@ -303,7 +303,7 @@ to distinguish it from newer standards.
 Support for this compilation environment is dependent on compilers supporting
 this configuration.
 Most of the old forms of C have been deprecated or removed in
-ISO/IEC 9899:2024 (“ISO C23”).
+.St -isoC-2024 .
 Compilers make compiling in this mode increasingly difficult and support for it
 may ultimately be removed from the tree.
 .It St -ansiC
@@ -333,11 +333,11 @@ since there are no new C17 only symbols or macros.
 .Pp
 This version of the standard did not introduce any new features, only made
 minor, technical corrections.
-.It ISO/IEC 9899:2024 (“ISO C23”)
+.It St -isoC-2024
 .Dv __STDC_VERSION__ = 202311L
 Strict environment selected with
 .Dv _C23_SOURCE
-though this is not yet implemented.
+though ISO C23 support is only partially implemented.
 .El
 .Pp
 For more information on C standards, see
@@ -356,25 +356,37 @@ However, system headers not defined by that standard may define extensions.
 .It Dv _POSIX_C_SOURCE = 199506 Ta St -p1003.1c-95 including St -ansiC
 .It Dv _POSIX_C_SOURCE = 200112 Ta St -p1003.1-2001 including St -isoC-99
 .It Dv _POSIX_C_SOURCE = 200809 Ta St -p1003.1-2008 including St -isoC-99
-.It Dv _POSIX_C_SOURCE = 202405 Ta in the future IEEE Std 1003.1-2024 (“POSIX.1”) including ISO/IEC 9899:2024 (“ISO C23”)
+.It Dv _POSIX_C_SOURCE = 202405 Ta St -p1003.1-2024 including ISO/IEC 9899:2018 ("ISO C17"),
 .It Dv _XOPEN_SOURCE = 500 Ta St -p1003.1c-95 and XPG extensions to St -susv2 including St -ansiC
 .It Dv _XOPEN_SOURCE = 600 Ta St -p1003.1-2001 and XPG extensions to St -susv3 including St -isoC-99
 .It Dv _XOPEN_SOURCE = 700 Ta St -p1003.1-2008 and XPG extensions to St -susv4 including St -isoC-99
-.It Dv _XOPEN_SOURCE = 800 Ta in the future IEEE Std 1003.1-2024 (“POSIX.1”) and XPG extensions to Version 5 of the Single UNIX Specification (“SUSv5”) including ISO/IEC 9899:2024 (“ISO C23”)
+.It Dv _XOPEN_SOURCE = 800 Ta St -p1003.1-2024 and XPG extensions to Version 5 of the Single UNIX Specification (“SUSv5”) including ISO/IEC 9899:2018 (“ISO C17”)
 .It Dv _ANSI_SOURCE Ta St -ansiC
 .It Dv _C99_SOURCE Ta St -isoC-99
 .It Dv _C11_SOURCE Ta St -isoC-2011
-.It Dv _C23_SOURCE Ta in the future ISO/IEC 9899:2024 (“ISO C23”)
+.It Dv _C23_SOURCE Ta St -isoC-2024
 .It Dv _BSD_SOURCE Ta Everything, including Fx extensions
 .El
 .Pp
+Note:
+.St -p1003.1-2024
+and XPG extensions to Version 5 of the Single UNIX Specification ("SUSv5")
+support is incomplete.
+.Pp
 When both POSIX and C environments are selected, the POSIX environment selects
 which C environment is used.
 However, when C11 dialect is selected with
 .St -p1003.1-2008 ,
 definitions for
 .St -isoC-2011
-are included.
+are also included.
+Likewise, when C23 dialog is selected with
+.St -p1003.1-2008
+or
+.St -p1003.1-2024 ,
+definitions for
+.St -isoC-2023
+are also included.
 .Ss Header Visibility Macros
 These macros are set by
 .Nm
@@ -393,13 +405,13 @@ by convention with 199009 for
 and 199209
 .St -p1003.1-90 .
 .It Dv __ISO_C_VISIBLE Ta The C level that's visible.
-Possible values include 1990, 1999, and 2011 for
+Possible values include 1990, 1999, 2011, 2017 and 2023 for
 .St -isoC-90 ,
-.St -isoC-99
-and
-.St -isoC-2011
+.St -isoC-99 ,
+.St -isoC-2011 ,
+ISO/IEC 9899:2018 ("ISO C17"), and
+.St -isoC-2024 ,
 respectively.
-In the future, 2023 will be used for ISO C2023.
 .It Dv __BSD_VISIBLE Ta 1 if the
 .Fx
 extensions are visible, 0 otherwise.