From 8e9cd2890ead7b9a16712e5a1444faf00e754aa7 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 4 Dec 2015 09:08:39 +0000 Subject: [PATCH] MFstable/10 r291754: 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 git-svn-id: svn://svn.freebsd.org/base/stable/9@291756 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- share/man/man9/style.9 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index ed65ac67b..1d0c7b34e 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 , -- 2.45.0