Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/usr.bin/tip



On Fri, Feb 24, 2012 at 09:27:09AM +0100, Joerg Sonnenberger wrote:
> On Fri, Feb 24, 2012 at 08:11:19AM +0000, David Laight wrote:
> > On Thu, Feb 23, 2012 at 11:39:19PM +0000, Joerg Sonnenberger wrote:
> > > Module Name:      src
> > > Committed By:     joerg
> > > Date:             Thu Feb 23 23:39:19 UTC 2012
> > > 
> > > Modified Files:
> > >   src/usr.bin/tip: cmds.c
> > > 
> > > Log Message:
> > > while (...);
> > >     ;
> > > is really pointless, so remove the first semicolon.
> > 
> > I tend to use an explicit 'continue' in such loops.
> > Much less confusing.
> 
> I generally agree, but putting the semicolon on a separate line is good
> enough for the purpose.

At least netbsd puts { and } on the same line as the keyword,
otherwise you can get things like:

                ...
        }
        while (....);
        {
                int foo;
                ...

where a cursory glance gives no real indication of what the
programmer intended (especially if the 'while' line is very long!)

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index