From nobody Sat Dec 14 00:11:55 2024 X-Original-To: dev-commits-src-branches@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 4Y968C3rNvz5gLsv; Sat, 14 Dec 2024 00:11:55 +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 4Y968C2wycz3x06; Sat, 14 Dec 2024 00:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734135115; 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=0LHcgH/tAYq1h7Eu1IsMgo4ijtFnTDrk5+bYUdO8cvI=; b=rGw4GqItQnXUMTS3FDve7qtagHQU4Lf5yq2DjIvf2cNYpfAu5EuSbj9KBTWCjk6KqvSvpl kD3sAfRYMFXtB0kHlmfS5DlismAHeh9tOfh43l39kqZPlOcbs0EswO/va8BMHLtuc0hFE9 4zSuVfYgcxa5hbf1wlz75vhgxJsC9ZbQa9YnmAFyCn/t9Hq0n7ZXx0QoM9tjIZvgb2mXqS szfJ8q51U+F1iUS2Sxq39LEEVSSRp+cpMKCFtpl95LBfLSLByv7ZR3Om8bUpCsgfk2/bSl VQZz7nu9c5wq59YiEBXFWEEPzO8AsxZxRxLu0K0AdeSCWaoWbHQOSsPHa80n5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734135115; 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=0LHcgH/tAYq1h7Eu1IsMgo4ijtFnTDrk5+bYUdO8cvI=; b=LT7LqzeQEDrx5PqcWxul0wt4VbCjEOHAB55KTjk8ucL6tHVLnH0dqAWKEubvlTwcRUAvMx dVbd69RspcR0Xe+ExD0CjxpOz9PgT/4D2LjFUZUtqLI4b76h7IpGVfZIWOEYx8AEu8zDom SAsVs+nOUkcDxvrRpaqjJ++YX5ixKsuQ02dNDZPzwzacshzx/+Y/Tw70mwTw/SAYmEQF/3 mcqVQkAWaoG2UuHjI+IlGYb+rYjHBQQYL/EgXae5V9rWqijbqe3NSKD0kD8LGJDA7tn4sU FHLDJdhlAuA4sneYJbk1g6y0zOMKglWliKb7ZR8IE3q8Sn1CCGJxzc4xby14Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734135115; a=rsa-sha256; cv=none; b=xAdtgl9fLVh6G/Mfb43KIuJEl0wg4fJkKaFYuCJqha22Mzfl9ZDSYHhmOHNCnMlSwT+iU9 0yJ5xXHbEyuWcXo1g9ykNhzbppvO03XMjdpIAxSxh2z+ND6m7YxYdM5EQ2Fgcqm2ILBsEC 3uxrzqi5UqK0tE4T8hqb6VUthRrMoUp73+npqU9X7p8cWh9HWKiWy2URXsAd8YsrQ2jPkB v/e6by/GEXp/Tr76dAWcEJmOmPkkfYVbVcvbRxohqqXvdx1PmhqJot+9PMmVHzZ9Q6tcy4 7r+pWT30vFkK+zTm8555TM7QdLKagjn7SHn2O3A0TBNG/EY8SDpOS8xEvF+qww== 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 4Y968C2W2fz10Mf; Sat, 14 Dec 2024 00:11:55 +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 4BE0Btjh055414; Sat, 14 Dec 2024 00:11:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BE0BtUA055411; Sat, 14 Dec 2024 00:11:55 GMT (envelope-from git) Date: Sat, 14 Dec 2024 00:11:55 GMT Message-Id: <202412140011.4BE0BtUA055411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 1ad44b7f0e0d - stable/14 - style: Allow C++ comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ad44b7f0e0d0960ec94ce4a7cdbd884499386c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=1ad44b7f0e0d0960ec94ce4a7cdbd884499386c9 commit 1ad44b7f0e0d0960ec94ce4a7cdbd884499386c9 Author: Warner Losh AuthorDate: 2024-07-25 04:34:56 +0000 Commit: Brooks Davis CommitDate: 2024-12-13 21:35:28 +0000 style: Allow C++ comments Attempt to craft the more-or-less conesnsus view on C++ BCPL-style comments. Allowing them seemed to have wide support. Consistent use was highly desired. What constituted consistent use, however, didn't have good consensus especially with multi-line comments. Craft something that's a little vague to allow what appears to be a range in common practices elsewhere and no good way to drive this do absolute agreement. We should revisit this point in 6-12 months after we get some experience with it. Sponsored by: Netflix Discussed with: many in the code reivew, see discussion there Differential Revision: https://reviews.freebsd.org/D35960 (cherry picked from commit 0a59a6b02fccef82644439a5165b7e0b751049c3) --- share/man/man9/style.9 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 2e7c614b2a6d..ca96f05f8d55 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -52,11 +52,17 @@ is silent on an issue. /* Most single-line comments look like this. */ +// Although they may look like this. + /* * Multi-line comments look like this. Make them real sentences. Fill * them so they look like real paragraphs. */ .Ed +C++ comments may be used in C and C++ code. +Single-line comments should be consistently either C or C++ within a file. +Multi-line comments should also be consistently either C or C++, but may differ +from single-line comments. .Pp The copyright header should be a multi-line comment, with the first line of the comment having a dash after the star like so: