git: a8fd8a5a365a - main - style.9: Avoid C++ keywords
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 19 Nov 2026 18:55:27 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=a8fd8a5a365a308c959798027717510fd72ae008
commit a8fd8a5a365a308c959798027717510fd72ae008
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2026-11-19 17:39:18 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-11-19 18:52:17 +0000
style.9: Avoid C++ keywords
Headers may be included by C++ code, and sometimes we might like to
use exinst code as C++. Encourage authors to avoid C++ keywords as
identifiers.
Reviewed by: des, imp (earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61767
---
share/man/man9/style.9 | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
index e019a26d73a8..c10bccdbc7e0 100644
--- a/share/man/man9/style.9
+++ b/share/man/man9/style.9
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 28, 2025
+.Dd November 19, 2026
.Dt STYLE 9
.Os
.Sh NAME
@@ -345,6 +345,20 @@ enum enumtype { ONE, TWO } et;
The use of internal_underscores in identifiers is preferred over
camelCase or TitleCase.
.Pp
+Avoid using C++ keywords
+.Po
+such as
+.Ql class ,
+.Ql new ,
+.Ql this ,
+or
+.Ql private
+.Pc
+as identifiers
+.Po
+for example, variable names or struct members
+.Pc .
+.Pp
In declarations, do not put any whitespace between asterisks and
adjacent tokens, except for tokens that are identifiers related to
types.