Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Aug 2016 10:39:24 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Alexey Dokuchaev <danfe@FreeBSD.org>, Jilles Tjoelker <jilles@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r303586 - head/bin/sh
Message-ID:  <1470069564.1283.20.camel@freebsd.org>
In-Reply-To: <20160731134316.GB85936@FreeBSD.org>
References:  <201607311311.u6VDBYr8066638@repo.freebsd.org> <20160731134316.GB85936@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2016-07-31 at 13:43 +0000, Alexey Dokuchaev wrote:
> On Sun, Jul 31, 2016 at 01:11:34PM +0000, Jilles Tjoelker wrote:
> > New Revision: 303586
> > URL: https://svnweb.freebsd.org/changeset/base/303586
> > 
> > Log:
> >   sh: Fix a clang warning.
> >   
> >   Submitted by:	bdrewery
> > 
> > Modified:
> >   head/bin/sh/expand.c
> > 
> > Modified: head/bin/sh/expand.c
> > ===================================================================
> > ===========
> > --- head/bin/sh/expand.c	Sun Jul 31 12:59:10 2016	(r3
> > 03585)
> > +++ head/bin/sh/expand.c	Sun Jul 31 13:11:34 2016	(r3
> > 03586)
> > @@ -473,7 +473,8 @@ expbackq(union node *cmd, int quoted, in
> >  		if (--in.nleft < 0) {
> >  			if (in.fd < 0)
> >  				break;
> > -			while ((i = read(in.fd, buf, sizeof buf))
> > < 0 && errno == EINTR);
> > +			while ((i = read(in.fd, buf, sizeof buf))
> > < 0 && errno == EINTR)
> > +				;
> 
> `continue;' would be even better; some tools might barf at stray
> semicolon.
> 
> ./danfe
> 

I strongly agree that the right way to do an empty loop is to use
"continue;" on a line by itself.  Unfortunately, what style(9) suggests
by way of example is a single semicolon on a line by itself with a
comment of "/* nothing */" to the right on the same line.  Ick.

-- Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1470069564.1283.20.camel>