From nobody Mon Nov 04 17:03:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhyTS5M0Zz5cKN7; Mon, 04 Nov 2024 17:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhyTS3lXGz400Q; Mon, 4 Nov 2024 17:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730739788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rV0eUhE0VHo3K1TxMeR1XsOxEM1VvzAkQXhsVh9EwrU=; b=LjIN2hwMJHOrZqKyp9PCiC+/IdCzoCxHFkKqc2riJk55WBYXkCx6ZhYBzvzYgd1OYuPy3P b+B0ZKapBbTTSISj1HNTcaastk6aN072OaItrAIlTc5zD+qNvATeZsSk/UxKt5AmQZgV/q DmG52MqiAOlgVCZTr03SfD6cx7VvCtXgcPUbXGOiR/Q073EZxcxOdhOXQIDKpGEsrjBxd3 ksN/dmw6aekl22bbzRPHkwlI+obZiAH9zmfGYszS1RfENXU2PGhV4nmUg2hrIHTc3nM2uw +EKw3JAihSVCSeRfk47LRvqgW1sP3OAAOL4ReiIXM1gBRhku8J08TwUCkL4ynQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730739788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rV0eUhE0VHo3K1TxMeR1XsOxEM1VvzAkQXhsVh9EwrU=; b=mB9lUu+eZjpUgfkEcGKL29p5tBIyeXz2Iz2Plqk6DXDCAcq9YIDgCmIivSHQS7P4TrVrYo gnRoPsETLvpJpZjvXKsBSVLMH9lCYepcL+Y08fpp8K9U2no1z1+ZbfhOwj9pgyqwKYuWvb EN7tACnZeWeOu0YPi8kWuRQ57e7Ihf5I1/r3saQc1ETIm/plpcSfIW1iTKUe6hSjOUHLXx riH/vshGHMWNXSLYDiofYAOYsQ2NWHu7XFX9EV0BrtHmSeH2ue7qoaBLIibvPK9f60rT9K lIfXe3eIpRwIuUqcvBL6dXIAcF5WOubTDlrAK72jCmvhBVwAEmYIYi5LGdj+og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730739788; a=rsa-sha256; cv=none; b=PLS5uRmQ7mBUCpah43P40nkAScRkL53AlC8OxQYpH/WZi7qz3S0E/p08GDHSck7n4Q1q7Q WDwIm+YskUV6m9hAVqAn0QFIyWtTIIKNuG/weMtLu9yyOroGmY7aqXhC7tKmVbbz73zz6F 49xag9Ip379ahL4oX4+PsQgjQ1wK9YjpSemEc0TMy9LtN6yvYPMiFLzH4QRxWFT2EizwLY ZRhQffrJQ12WWMhnpQk10QsPEZ+b93Bd8TqUC6PFLuq1rx/CtJnEi4fRwr9rMvCF2Vbpyz OpsSIZcQak3oQ2N+YRvmmXLrGgSBt0yi1UYSH7xTqAKFo8uvNBqZAE9vSy4WXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhyTS3JnwzhsS; Mon, 4 Nov 2024 17:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4H38Bx003377; Mon, 4 Nov 2024 17:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4H38s2003374; Mon, 4 Nov 2024 17:03:08 GMT (envelope-from git) Date: Mon, 4 Nov 2024 17:03:08 GMT Message-Id: <202411041703.4A4H38s2003374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 930654318ece - main - c(7): Add C23 standard update List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 930654318ecee172e4fc1ce57f21b4fb7b12603e Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=930654318ecee172e4fc1ce57f21b4fb7b12603e commit 930654318ecee172e4fc1ce57f21b4fb7b12603e Author: Faraz Vahedi AuthorDate: 2024-11-01 21:38:36 +0000 Commit: Brooks Davis CommitDate: 2024-11-04 16:40:52 +0000 c(7): Add C23 standard update Reviewed by: emaste, Graham Percival Pull Request: https://github.com/freebsd/freebsd-src/pull/1507 Signed-off-by: Faraz Vahedi --- ObsoleteFiles.inc | 3 + share/man/man7/Makefile | 3 +- share/man/man7/c.7 | 169 ++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 160 insertions(+), 15 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d9a8467443da..142a389a8e7a 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20241104: remove the outdated c2x.7 symlink in favor of c23.7 +OLD_FILES+=usr/share/man/man7/c2x.7.gz + # 20241023: new clang import which bumps version from 18 to 19 OLD_FILES+=usr/lib/clang/18/include/__clang_cuda_builtin_vars.h OLD_FILES+=usr/lib/clang/18/include/__clang_cuda_cmath.h diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 67cca438a46d..2c4f158280f7 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -42,7 +42,8 @@ MLINKS+= c.7 c95.7 MLINKS+= c.7 c99.7 MLINKS+= c.7 c11.7 MLINKS+= c.7 c17.7 -MLINKS+= c.7 c2x.7 +MLINKS+= c.7 c23.7 +MLINKS+= c.7 c2y.7 .if ${MK_INET} != "no" MAN+= networking.7 diff --git a/share/man/man7/c.7 b/share/man/man7/c.7 index 7c180797d296..c95bab1c1f19 100644 --- a/share/man/man7/c.7 +++ b/share/man/man7/c.7 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 20, 2021 +.Dd November 4, 2024 .Dt C 7 .Os .Sh NAME @@ -34,7 +34,8 @@ .Nm c99 , .Nm c11 , .Nm c17 , -.Nm c2x +.Nm c23 , +.Nm c2y .Nd The C programming language .Sh DESCRIPTION C is a general purpose programming language, which has a strong connection @@ -239,17 +240,154 @@ It incorporates the Technical Corrigendum 1 (ISO/IEC 9899:2011/COR1:2012) which was published in 2012. It addressed defects and deficiencies in C11 without introducing new features, only corrections and clarifications. -Since there were no major changes in C17, the current standard for -Programming Language C, is still considered C11 \(em ISO/IEC 9899:2011, published -2011-12-08. .Pp -The next standard, the fifth, is currently referred to as C2x and is scheduled -to be adopted by the end of 2021, with a publication date of 2022. -When published, it will cancel and replace the fourth edition, ISO/IEC -9899:2018. +C23, formally ISO/IEC 9899:2024, is the current standard with significant +updates that supersede C17 (ISO/IEC 9899:2018). +The standardization effort began in 2016, informally as C2x, with the first +WG14 meeting in 2019, and was officially published on October 31, 2024. +C23 was originally anticipated for an earlier release, but the timeline was +extended due to COVID-19 pandemic. +With C23, the value of __STDC_VERSION__ has been updated from 201710L to +202311L. +Key changes include (but are not limited to) the following: +.Bl -bullet -offset indent +.It +Add null pointer type nullptr_t and the nullptr keyword +.It +Add constexpr keyword as a storage-class specifier for objects +.It +Redefine the usage of the auto keyword to support type inference while also +retaining its previous functionality as a storage-class specifier when used +with a type +.It +Add %b binary conversion specifier to the +.Fn printf +and +.Fn scanf +function families +.It +Add binary conversion support (0b and 0B) to the +.Fn strtol +and +.Fn wcstol +function families +.It +Add the #embed directive for binary resource inclusion and __has_embed to +check resource availability with preprocessor directives +.It +Add the #warning directive for diagnostics +.It +Add the #elifdef and #elifndef directives +.It +Add the u8 prefix for character literals to represent UTF-8 encoding, +compatible with C++17 +.It +Add the char8_t type for UTF-8 encoded data and update the types of u8 +character constants and string literals to char8_t +.It +Add functions +.Fn mbrtoc8 +and +.Fn c8rtomb +to convert between narrow multibyte +characters and UTF-8 encoding +.It +Define all char16_t strings and literals as UTF-16 encoded and char32_t +strings and literals as UTF-32 encoded unless specified otherwise +.It +Allow storage-class specifiers within compound literals +.It +Support the latest IEEE 754 standard, ISO/IEC 60559:2020, with binary and +(optional) decimal floating-point arithmetic +.It +Add single-argument _Static_assert for compatibility with C++17 +.It +Add _Decimal32, _Decimal64, _Decimal128 keywords for (optional) decimal +floating-point arithmetic +.It +Add digit separator ' (the single quote character) for literals +.It +Enable specification of the underlying type of an enum +.It +Standardize the +.Fn typeof +operator +.It +Add +.Fn memset_explicit +in +.In string.h +to securely erase sensitive data +regardless of optimizations +.It +Add +.Fn memccpy +in +.In string.h +for efficient string concatenation +.It +Add +.Fn memalignment +in +.In stdlib.h +to determine pointer alignment +.It +Add +.Fn strdup +and +.Fn strndup +in +.In string.h +to allocate string copies +.It +Introduce bit utility functions, macros, and types in the new header +.In stdbit.h +.It +Add +.Fn timegm +in +.In time.h +for converting time structures to calendar time +values +.It +Add __has_include for header availability checking via preprocessor +directives +.It +Add __has_c_attribute to check attribute availability via preprocessor +directives +.It +Add _BitInt(N) and unsigned _BitInt(N) for bit-precise integers, and +BITINT_MAXWIDTH for maximum bit width +.It +Elevate true and false to proper keywords (previously macros from +.In stdbool.h ) +.It +Add keywords alignas, alignof, bool, static_assert, thread_local; previously +defined keywords remain available as alternative spellings +.It +Enable zero initialization with {} (including initialization of VLAs) +.It +Introduce C++11 style attributes using [[]], with adding [[deprecated]], +[[fallthrough]], [[maybe_unused]], [[nodiscard]], and [[noreturn]] +.It +Deprecate _Noreturn, noreturn, header +.In stdnoreturn.h +features introduced +in C11 +.It +Remove trigraph support +.It +Remove K&R function definitions and declarations +.It +Remove non-two's-complement representations for signed integers +.El .Pp -Some useful features have been provided as extensions by some compilers, but -they cannot be considered as standard features. +The next version of the C Standard, informally named C2y, is anticipated +to release within the next six years, targeting 2030 at the latest. +A charter for C2y is still being drafted and discussed, with several +papers under debate from the January 2024 meeting in Strasbourg, France +indicating that this new version may address long-standing requests and +deficiencies noted by the C community, while preserving its core strengths. .Pp ISO/IEC JTC1/SC22/WG14 committee is responsible for the ISO/IEC 9899, C Standard. @@ -377,6 +515,11 @@ C Standard. .%A ISO/IEC .%T 9899:2018 (aka C17) .Re +.Pp +.Rs +.%A ISO/IEC +.%T 9899:2024 (aka C23) +.Re .Sh HISTORY This manual page first appeared in .Fx 9.0 . @@ -384,8 +527,6 @@ This manual page first appeared in .An -nosplit This manual page was originally written by .An Gabor Kovesdan Aq Mt gabor@FreeBSD.org . -It was updated for -.Fx 14.0 -by +It was updated by .An Faraz Vahedi Aq Mt kfv@kfv.io with information about more recent C standards.