Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2024 04:49:06 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0a59a6b02fcc - main - style: Allow C++ comments
Message-ID:  <202407250449.46P4n6q4032097@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=0a59a6b02fccef82644439a5165b7e0b751049c3

commit 0a59a6b02fccef82644439a5165b7e0b751049c3
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-25 04:34:56 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-25 04:46:02 +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
---
 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 daddc57bfb1f..80099b67831c 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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407250449.46P4n6q4032097>