Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jul 2016 22:33:29 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        Alexey Dokuchaev <danfe@freebsd.org>, src-committers <src-committers@freebsd.org>,  "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>,  "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r303586 - head/bin/sh
Message-ID:  <CANCZdfqzQO5f_MSCj9pZ63qZO5cSMy6ym9%2BkhVkZ8pVuLXUyEg@mail.gmail.com>
In-Reply-To: <20160731201614.GA58505@stack.nl>
References:  <201607311311.u6VDBYr8066638@repo.freebsd.org> <20160731134316.GB85936@FreeBSD.org> <20160731201614.GA58505@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 31, 2016 at 2:16 PM, Jilles Tjoelker <jilles@stack.nl> wrote:
> On Sun, Jul 31, 2016 at 01:43:16PM +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        (r303585)
>> > +++ head/bin/sh/expand.c    Sun Jul 31 13:11:34 2016        (r303586)
>> > @@ -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.
>
> Both continue; and ; (the latter with and without comment) occur in the
> source tree many times. I don't really like a continue that does nothing
> because it is at the end of a loop, so I prefer to make this whitespace
> change only (there are two more instances in bin/sh). I think a sole
> semicolon on a line is conspicuous enough that nothing additional is
> required.

For humans, yes. For picky tools that warn about strange constructs, no.
Clang may be happy, but there's many other tools that expect you to declare
an 'empty' while loop with continue. This tradition has dated back to
at least the
late 80's...

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqzQO5f_MSCj9pZ63qZO5cSMy6ym9%2BkhVkZ8pVuLXUyEg>