From owner-freebsd-arch@freebsd.org Tue May 28 22:13:56 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 541E415AE057 for ; Tue, 28 May 2019 22:13:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 86B376DB2A for ; Tue, 28 May 2019 22:13:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: by mailman.ysv.freebsd.org (Postfix) id 3D32915AE055; Tue, 28 May 2019 22:13:55 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B96415AE054 for ; Tue, 28 May 2019 22:13:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 979106DB27; Tue, 28 May 2019 22:13:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 20B864398CE; Wed, 29 May 2019 08:13:43 +1000 (AEST) Date: Wed, 29 May 2019 08:13:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: "freebsd-arch@freebsd.org" Subject: Re: style.9 RFC: Permit eliding blank lines in small functions In-Reply-To: Message-ID: <20190529065949.L2755@besplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=OVlJzIpLT-XgbAEhD4EA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 979106DB27 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.947,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 22:13:56 -0000 On Tue, 28 May 2019, Conrad Meyer wrote: > I have proposed a small change to style.9 here: > > https://reviews.freebsd.org/D20448 Why not propose it here (on this list). > I believe this has been generally permitted in practice and the change > is mostly to codify existing unwritten standards, rather than to > change them. The goal of this thread is to determine if we do have > general consensus for the concept. It is a strange not very good rule, but it is a fundamental part of KNF. The wording for the change is bad. "excluded" makes no sense. It means closer to "omitted". "may be excluded" means "the empty line required by the previous clause is not actually required [for short functions]". Another bug in this section is the use of "empty" for lines. Everywhere else in style(9) (4 instances) uses the less precise term "blank". indent(1) consistently uses "blank" (11 instances), including for its -sob option for removing evil b's. The SunOS/zol style guide also has bugs in this area. -sob is specifically documented in indent(1) as being good for removing this particular optional blank line, but the man page is out of date. indent also has options -[n]bad and -[n]badp which interact in confusing ways with -sob even if you know that they exist and what they are set to. indent of course doesn't understand "may be excluded" so with a KNF .indent.pro it fixes any exclusions. -[n]badp was added to it recently to give more control over the blank line after the first set of declarations when this set is null. This area would be even more complicated and buggier if indent understood "may be excluded". It would need something like a numeric arg for -[n]badp to allow exceptions for short functions. Bruce