Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Aug 2010 10:43:07 -0700
From:      Brian Somers <brian@FreeBSD.org>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r211609 - head/tools/regression/bin/sh/builtins
Message-ID:  <20100824104307.54ca6c2a@FreeBSD.org>
In-Reply-To: <20100823215850.GC67671@stack.nl>
References:  <201008221104.o7MB4Ung001538@svn.freebsd.org> <20100823003314.57d41b94@dev.lan.Awfulhak.org> <20100823215850.GC67671@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 23 Aug 2010 23:58:50 +0200, Jilles Tjoelker <jilles@stack.nl> wrote:
[.....]
> > > ==============================================================================
> > > --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> > > +++ head/tools/regression/bin/sh/builtins/break3.0	Sun Aug 22 11:04:30 2010	(r211609)
> > > @@ -0,0 +1,15 @@
> > > +# $FreeBSD$
> > > +
> > > +# We accept this and people might rely on it.
> > > +# However, various other shells do not accept it.
> > > +
> > > +f() {
> > > +	break
> > > +	echo bad1
> > > +}
> > > +
> > > +while :; do
> > > +	f
> > > +	echo bad2
> > > +	exit 2
> > > +done
[.....]
> > Having said that, this behaviour is the same in bash except that bash
> > will complain if it's asked to break when the context is wrong,
> > perhaps we should complain too?
[.....]
> Warning messages to stderr mostly get lost in the noise, I don't really
> like them. I do not expect people to test for failure of break and
> continue, and bash even sets $? to 0 despite printing a warning. If this
> error is so important as to need an error message I think should abort
> the shell as well (via error(), so that "command break" will avoid
> aborting).
> 
> Furthermore note that bash disables these warnings in POSIX mode.
[.....]

I agree then, no error seems like the right thing to do.

Thanks.

-- 
Brian Somers                                       <brian@Awfulhak.org>
Don't _EVER_ lose your sense of humour !            <brian@FreeBSD.org>



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