Date: Sun, 11 May 2014 13:17:46 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Konstantin Belousov <kib@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r265845 - head/lib/libc/gen Message-ID: <20140511125426.P989@besplex.bde.org> In-Reply-To: <201405101859.s4AIxAor079383@svn.freebsd.org> References: <201405101859.s4AIxAor079383@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 10 May 2014, Konstantin Belousov wrote: > Log: > Style. Thanks, but this adds a style bug of the same type as one that it removes. > Modified: head/lib/libc/gen/sem_new.c > ============================================================================== > --- head/lib/libc/gen/sem_new.c Sat May 10 17:42:21 2014 (r265844) > +++ head/lib/libc/gen/sem_new.c Sat May 10 18:59:09 2014 (r265845) > @@ -294,13 +294,13 @@ _sem_unlink(const char *name) > return -1; > } > name++; > - Was an extra blank line. > strcpy(path, SEM_PREFIX); > if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { > errno = ENAMETOOLONG; > return (-1); > } > - return unlink(path); > + Now an extra blank line. > + return (unlink(path)); > } > > int Statements are not separated by blank lines in KNF except in exceptional circumstances. In strict KNF, even blocks starting with a block comment are not separated by blank lines. This is too much for me, so my rule is to always use blank lines for sections beginning with a comment and rarely use them otherwise (maybe every 20 lines). This file has several other style bugs. indent(1) fixes the following formatting ones: - trailing whitespace - missing indentation in struct declaration - doubled spaces after &ma - several more instances of an extra blank line - missing spaces around binary operators (about 10 instances) - non-cuddled else - non-KNF continuation indentation - missing space after 'while' indent(1) doesn't understand its own -lp option and fails to fix long lines and otherwise miswrapped lines, except for the continuation indentation. Variant formatting of extra blank lines (to remove the one that you removed and add the one that you added) would be impossibly difficult for indent(1) to fix or preserve. Non-formatting style bugs are harder to fix. Altogether, there are style bugs on about 10% of lines. Below average ugliness. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140511125426.P989>