From nobody Thu Jul 25 04:49:06 2024 X-Original-To: dev-commits-src-all@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 4WTz1Z5VgSz5RFp0; Thu, 25 Jul 2024 04:49:06 +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 4WTz1Z45gPz4Ws2; Thu, 25 Jul 2024 04:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721882946; 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=F8ZKSlp3hko5vga9Vn0R4Zhn6G3490jH5h5vfTlYmjk=; b=vbFnnAN8hTG/mQRY4TVUddnOnUqAnK3m0/LVCQRfW8A7XI7ZsFmBeacsbwTcMZL0A28zbQ 0HY+SlqicX6kMyEKg4hFejpcSM3OU3FhQ2vMrJJFr5BtBYja505a78hdyXFL0dw5zt/XGk pzl58J07IIwhiY9VaA9Ogwn9OFVa/evG6UYpLbFrAWm3GTCHqAhOSKO31r1GrhSY8Gx86P BcBORAq+iiVwwxSpATvLRogtgmjupOv8W84Whby9JIih5BV8eRs8YUIfL+pemqfEgnbGMi vljHkZ1S+WSZG4R6SRKaLpGr2KtHLKaQgz3EnUAGy0TM435MF+/pDY7UFZd8WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721882946; a=rsa-sha256; cv=none; b=FufeDADiwUIooBFazICeThAvhPTUutaPScwdzJRVNj+ikGBPMap+Q26zZhXP+iBxi1K25r zEusjreRXdzX56rvxCEpa6XkXesKUgBYPT0Up7EKJrqYQis9B3F5xvpQ79NEYcsupMWjzf cjkSWzS6ltgnOQagk1Ruy8dmB1ehFzi33oMyB8yGiRFZ+mqPL6nq9lZRu0uy6lSM9dY6vq VTReVZ4QaqHBUdDJ5vG05n07ZufMLm1/4hPFC3EropDiCvaMIgVFLnfWRa1JG1E3rrsizz VueHg3jkL0TKnzO00c/JuZ2g0jnZNnIzpCzETSLbo4yrsntzy5jj7BqH7aNtWg== 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=1721882946; 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=F8ZKSlp3hko5vga9Vn0R4Zhn6G3490jH5h5vfTlYmjk=; b=Ki+H+5/H0Kg7F9rKY6PZgK7vW6OtVYDqmHI/8vB8d1F29aK12OGxc8aNQgBb+7Pc9Cmbcx 5lKhM3SpcP1X3DQUkeEUiMvatJe3XLRzy8GUMo4taxkeTJp0hkmhgZolZwTdqYiMzuFihg Y1OcmiY/+Rw5QwsDCEyu37hsbyYILiY/QWAcOUlVso7E+WqrlZQOAoxTLamHITAN4mR6BW 7UiPC53x+TkV9TIbo4rDnN4/q351ug97Bbq4lPLJftXbXmPpdQfssSB7NN4MFhCxNUTSSA VWxUQ6+MuvHhP/ehzQglM7e4AvzSGb8TNbKTgX6K8Q0NMZjLjSEVSyp51Aqt8g== 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 4WTz1Z3jnHzgx4; Thu, 25 Jul 2024 04:49:06 +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 46P4n6Rq032100; Thu, 25 Jul 2024 04:49:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P4n6q4032097; Thu, 25 Jul 2024 04:49:06 GMT (envelope-from git) Date: Thu, 25 Jul 2024 04:49:06 GMT Message-Id: <202407250449.46P4n6q4032097@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: 0a59a6b02fcc - main - style: Allow C++ comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 0a59a6b02fccef82644439a5165b7e0b751049c3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0a59a6b02fccef82644439a5165b7e0b751049c3 commit 0a59a6b02fccef82644439a5165b7e0b751049c3 Author: Warner Losh AuthorDate: 2024-07-25 04:34:56 +0000 Commit: Warner Losh 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: