git: 1ad44b7f0e0d - stable/14 - style: Allow C++ comments
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 14 Dec 2024 00:11:55 UTC
The branch stable/14 has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=1ad44b7f0e0d0960ec94ce4a7cdbd884499386c9
commit 1ad44b7f0e0d0960ec94ce4a7cdbd884499386c9
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-25 04:34:56 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
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: