From owner-svn-src-all@freebsd.org Mon Aug 1 06:01:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0514BAC80B for ; Mon, 1 Aug 2016 06:01:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 778A61B7D for ; Mon, 1 Aug 2016 06:01:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id m101so177636984ioi.2 for ; Sun, 31 Jul 2016 23:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HDJdJ67Gxxd3WDj35/3pjqc5U0plNcP4Hkl0zKFbXOY=; b=g+vkepOHDE5ZbFRneotnA1OWXjzjPtVF4lH3i6eHPE7NVr7cgDifx+JOkDIIzhgsoz SC3eVHrv51Z/CWqFlTpJ9XRvZoybWiGQPstBiCxA8LKNXi217TVlVmN1Ko7/sebUaiFM T2FBWvORn7W+HbcK3aWtRhhpsOJC515ZuS3tymcwAoWXLnVUu9L25zpq5MobBzkbML/4 B3zEeVek79lIQu0CC+P6H4th2LgZ7MKvjLE/3BEK7MbEYGlbkiAWK0Rsmt2cmm1i3KTy kFUQCG524nya8ltm66oyuNVVsKMhad4d4Y4h1qmRK14duImRjU8zWcJJVQKzzT2cPHSe RhrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HDJdJ67Gxxd3WDj35/3pjqc5U0plNcP4Hkl0zKFbXOY=; b=HYamTC9bGZEkg47+x5+3Y7T/7SbizOWQve6Ah4kyhC26p6QmFEiG3ldPmTl00+g671 v8H24ytaucgNoYxNqFH7FskSfXoQvVYgyXUiS3GAGTekXyIX6pbpaqep+8yI8vne/vYr cRIH61CHS7uv86kYTAZgzayROJ/oOAnKYNRN9RjVti2r5W6Hvq1ISMAjk5nVTW5YOBen M03DPC+gmbgH2MNRbFubmgIwHfGI38xK41p5asWWgPJdueqKlamFro1wG6USCqJd8Mrh Jioi/rigrFQf5TfAZFfdACVopHPqMbU0AlH637WRJzV/ksO86izkWlAnS4UvNtI0vBVl YijQ== X-Gm-Message-State: AEkoouuAdDYBZ2RgBcw/qam8z1fyCSav3Ok4M1FqxE7eMEE68sylnSXX1Eh+qymERDY6vC64Pta5GsbgjAftVA== X-Received: by 10.107.133.93 with SMTP id h90mr53799073iod.16.1470031311875; Sun, 31 Jul 2016 23:01:51 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.137.131 with HTTP; Sun, 31 Jul 2016 23:01:51 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160801154048.K884@besplex.bde.org> References: <201607311311.u6VDBYr8066638@repo.freebsd.org> <20160731134316.GB85936@FreeBSD.org> <20160731201614.GA58505@stack.nl> <20160801154048.K884@besplex.bde.org> From: Warner Losh Date: Mon, 1 Aug 2016 00:01:51 -0600 X-Google-Sender-Auth: hcoIaCCw562Jg0CA4I__HdOYlio Message-ID: Subject: Re: svn commit: r303586 - head/bin/sh To: Bruce Evans Cc: Jilles Tjoelker , Alexey Dokuchaev , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 06:01:52 -0000 On Sun, Jul 31, 2016 at 11:51 PM, Bruce Evans wrote: > On Sun, 31 Jul 2016, Warner Losh wrote: > >> On Sun, Jul 31, 2016 at 2:16 PM, Jilles Tjoelker 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... > > > Buggy tools. I thought that programmers used the stand-alone semicolon > since that is shorter and clearer. It cannot be on the same line though. > The stand-alone semicolon is bad if it is misformatted. 'while(foo());' > is shorter and unclearer. A C parser must ignore whitespace, so you > need a tool like indent that sort of understands whitespace to disallow > while(foo()); but accept 'while (foo())\n\t;'. It is not far from full > indent(1) and insisting on the correct number of \t's before the semicolon. A C parser doesn't completely ignore the whitespace if it doesn't warn in both cases... Warner