From nobody Sat Jul 20 15:50:58 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 4WR9xb0ZbHz5RtCQ; Sat, 20 Jul 2024 15:50:59 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WR9xZ2Scbz4RgC; Sat, 20 Jul 2024 15:50:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721490658; 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=evO/UV4DttvPzxEmUyRQVLmdbPUZLVuzhnUL6BXS6RY=; b=ZiilPv2m93enp0dxa+4Sm7I1sztNUlIKM7lovirrT1W/AktsDLi2Ad9YHfu6au/w0HLBaF WBd7pYtpx7/ox3DO0HrQiB3k6F/x5XePPegGmzKZaxhm2hW9kt4LAEy6fejUWBPzco+Kpq DtDwhRQ02lMm42rxS7lf7Rdpzx3qfaAFyrK7Cr5FbU5hwG326a+9ImbJWTHJiGlJl+Q+8E s4rx5OrRQc/x4sERF6LVIKJPvDq20si58PM+iWWqxoY3J4hrBPvnRVOogc0wq9c20QYsUT id2NtM/6Crimik5RceO4+uSHcjBBjsW38dg3jBrHyZ83fenm/Z23fdnyANxevg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721490658; a=rsa-sha256; cv=none; b=CiTyRWLxVD2i/L6FnhaULTUALPb2tJjfY4vUd21aiJ2IrPvnJ/0J03ziDLFr6Jo28T+N1A WchB++HQW6pKVi7duNKhcHPzKUXIW3URv5yTrPvPgm/Y6MS5bEvsItgBEcISYJsOif/e19 4J8lAEJSkjir1dAMr6U6+1M+paX2QaIrFXS+xT/8UpXT+HZkuuS9h1+2esPNEfDbZcSs3Q 4bJsEVnGE5orY5jvnOu3czj2SlVFOrqoBdjp+Bsa58hC0E/2GZPpSx3ljIaeejVC1DqJRs l9xbGfh5QfwPQglnxBMPWbqWK3cxT0SrCPLSCHrf6OElwFHNoIdle75h1RbbqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721490658; 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=evO/UV4DttvPzxEmUyRQVLmdbPUZLVuzhnUL6BXS6RY=; b=silG5LsLDTMxe+k720WYrtnWkG1bxUGBAbT3/sJHvDMXHHWzzP0mxoQdD8Tj+nFeBAc3J4 0DtFdai3nMKZwbR00yZv5w9IaVHeL+cJF7HbbbwF5DJOPnT800vcQNDND3/WxyRb5ItmlC XArKYJ7i+yJwjEyjyV3JyffaHm1QLguTlFBqNpfauho+e3XZy11KPuzKtQbjUuOplw63so PSvgPLv1EOm8e9lu+F70nRWNbqH6vIR5ADjOXjfgfhh5rFQVDKGyeEQt2Ho0ha/TcHLIIc 5i9mUWcRNDfn/L7d1WTK8MyH15Vw5PHHXHseYTsid6yrb0P7USo/CC++oGaStA== 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 4WR9xZ24B5zN04; Sat, 20 Jul 2024 15:50:58 +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 46KFowPE038624; Sat, 20 Jul 2024 15:50:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46KFows8038621; Sat, 20 Jul 2024 15:50:58 GMT (envelope-from git) Date: Sat, 20 Jul 2024 15:50:58 GMT Message-Id: <202407201550.46KFows8038621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: eaa3d34b6220 - main - cdefs.9: Update for C++ environments 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eaa3d34b6220d8858eabc622165ec4db2cc75e96 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eaa3d34b6220d8858eabc622165ec4db2cc75e96 commit eaa3d34b6220d8858eabc622165ec4db2cc75e96 Author: Warner Losh AuthorDate: 2024-07-20 14:38:52 +0000 Commit: Warner Losh CommitDate: 2024-07-20 15:50:38 +0000 cdefs.9: Update for C++ environments We support all the C++ standards to some degree. However, pre C++11 standard support has been disappearing upstream, so also add a note about -pedantic-errors might not work for earlier standards. Add note about __cplusplus values. Sponsored by: Netflix --- share/man/man9/cdefs.9 | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9 index 71b3e7fd4f81..dd45e3f61a9f 100644 --- a/share/man/man9/cdefs.9 +++ b/share/man/man9/cdefs.9 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd July 18, 2024 +.Dd July 20, 2024 .Dt CDEFS 9 .Os .Sh NAME @@ -281,7 +281,7 @@ still uses these. supports a number C standard environments. Selection of the language dialect is a compiler-dependent command line option, though it is usually -.Fl cstd=XX +.Fl std=XX where XX is the standard to set for compiling, such as c89 or c23. .Fx provides a number of selection macros to control visibility of symbols. @@ -402,6 +402,45 @@ extensions are visible, 0 otherwise. .St -isoC-2011 Appendix K 3.7.4.1 extensions are visible, 0 otherwise. +.Sh Supported C++ Environments +.Fx +supports C++11 and newer standards fully. +.Bl -tag +.It ISO/IEC 14882:1998 ("C++98") +.Dv __cplusplus = 199711 +.Pp +The first standardized version of C++. +Unlike K \*(Am R support in C, compilers dropped support for versions of +the language prior to C++98. +.It ISO/IEC 14882:2003 ("C++03") +.Dv __cplusplus = 199711 +.Pp +Note, this is the same value as C++98. +C++03 did not define a new value for +.Dv __cplusplus . +There is no way, at compile time, to detect the difference. +The standard resolved a number of defect reports and slightly +expanded value initialization. +Most compilers support it the same as C++98. +.It ISO/IEC 14882:2011 ("C++11") +.Dv __cplusplus = 201103 +.It ISO/IEC 14882:2014 ("C++14") +.Dv __cplusplus = 201402 +.It ISO/IEC 14882:2017 ("C++17") +.Dv __cplusplus = 201703 +.It ISO/IEC 14882:2020 ("C++20") +.Dv __cplusplus = 202002 +.It ISO/IEC 14882:2023 ("C++23") +.Dv __cplusplus = 202302 +.El +.Pp +.Fx +uses llvm project's libc++. +However, they are removing support for C++ prior to C++11. +While programs can still build with earlier environments for now, these changes +mean that +.Fl pedantic-errors +cannot be reliably enabled for standards older than C++11. .Sh HISTORY .In sys/cdefs.h first appeared in