Date: Wed, 29 May 2019 08:13:41 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Conrad Meyer <cem@freebsd.org> Cc: "freebsd-arch@freebsd.org" <arch@freebsd.org> Subject: Re: style.9 RFC: Permit eliding blank lines in small functions Message-ID: <20190529065949.L2755@besplex.bde.org> In-Reply-To: <CAG6CVpX3f%2B7VZpLqRmH4mztw8RkVAZEa3NxB3ET%2B-ADDEvtZfA@mail.gmail.com> References: <CAG6CVpX3f%2B7VZpLqRmH4mztw8RkVAZEa3NxB3ET%2B-ADDEvtZfA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190529065949.L2755>