summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-04 09:07:18 +0000
committerngie <ngie@FreeBSD.org>2015-12-04 09:07:18 +0000
commite6a699bf6061537d3d3d537f8f0f5b7882924bf6 (patch)
treef9ee0f22ca6417b5d01f385950b87ea215898063
parentfdc1215ebe5182b5e2cd7afb01377a6d2e5d5781 (diff)
downloadFreeBSD-src-e6a699bf6061537d3d3d537f8f0f5b7882924bf6.zip
FreeBSD-src-e6a699bf6061537d3d3d537f8f0f5b7882924bf6.tar.gz
MFC r284527,r284528,r284608,r285219,r291166,r291167:
r284527 (by imp): Update style.9 to reflect consensus on developer's mailing list allowing redundant braces. Differential Revision: https://reviews.freebsd.org/D2842 r284528 (by imp): Bump date. Submitted by: Xin Li r284608 (by imp): Back out contested change until dispute is resolved. This proved to be more contentious than I expected. r285219 (by imp): The results of the vote are in. This reflects that vote. Single line statements inside of braces is recognized as an acceptable style. http://reviews.freebsd.org/V3 As always, this isn't license for wholesale change, etc. r291166: Recommend cc -Wall instead of gcc -Wall r291167: Bump .Dd
-rw-r--r--share/man/man9/style.913
1 files changed, 7 insertions, 6 deletions
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
index ed65ac6..1d0c7b3 100644
--- a/share/man/man9/style.9
+++ b/share/man/man9/style.9
@@ -26,7 +26,7 @@
.\" From: @(#)style 1.14 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
-.Dd January 7, 2010
+.Dd November 22, 2015
.Dt STYLE 9
.Os
.Sh NAME
@@ -503,13 +503,14 @@ Code which is unreachable for non-obvious reasons may be marked /*
.Pp
Space after keywords
.Pq Ic if , while , for , return , switch .
-No braces
+Two styles of braces
.Ql ( \&{
and
.Ql \&} )
-are
-used for control statements with zero or only a single statement unless that
-statement is more than a single line in which case they are permitted.
+are allowed for single line statements.
+Either they are used for all single statements, or
+they are used only where needed for clarity.
+Usage within a function should be consistent.
Forever loops are done with
.Ic for Ns 's ,
not
@@ -833,7 +834,7 @@ Whenever possible, code should be run through a code checker
(e.g.,
.Xr lint 1
or
-.Nm gcc Fl Wall )
+.Nm cc Fl Wall )
and produce minimal warnings.
.Sh SEE ALSO
.Xr indent 1 ,
OpenPOWER on IntegriCloud