Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2002 12:11:34 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        "J. Mallett" <jmallett@FreeBSD.ORG>
Cc:        Brian Somers <brian@Awfulhak.org>, Mike Barcroft <mike@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/usr.bin/tee tee.c 
Message-ID:  <200205171111.g4HBBYWs091280@hak.lan.Awfulhak.org>
In-Reply-To: Message from "J. Mallett" <jmallett@FreeBSD.ORG>  of "Fri, 17 May 2002 11:03:41 -0000." <20020517110339.GB9781@FreeBSD.ORG> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On Fri, May 17, 2002 at 11:41:16AM +0100, Brian Somers wrote:
> > > J. Mallett <jmallett@FreeBSD.org> writes:
> > > > jmallett    2002/05/16 19:28:47 PDT
> > > > 
> > > >   Modified files:
> > > >     usr.bin/tee          tee.c 
> > > >   Log:
> > > >   Remove spurious casts in malloc(3)'s argument.
> > > 
> > > Okay.
> > > 
> > > >   Use `return' instead of `exit' at the bottom of main().
> > > 
> > > This part is wrong.  The usual style for BSD software is to identify
> > > exit points with explicit exit() calls.
> > 
> > I think this has been discussed a number of times on the lists.  No 
> > decision was made either way.  style(9) says nothing about it.
> > 
> > Personally I prefer return because of the C++ implications, but 
> > that's a weak argument.  I suspect the sysinstall crunch stuff 
> > prefers return too (but that's a guess).
> > 
> > So the ``wrongness'' was in changing exit to return, not the use of 
> > either.  It's up to the individual which they use, but people 
> > shouldn't change from one to the other without a good reason.
> 
> So control of the main() function doesn't end without a return as the
> compiler thinks because it doesn't realise exit() eats program flow.

exit() is marked _dead2, ie, it doesn't return.

> Still though, I can back it out.

IMHO it would be only twice as wrong to back it out :*)

> -- 
> jmallett@FreeBSD.org   | C, MIPS, POSIX, UNIX, BSD, IRC Geek.
> http://www.FreeBSD.org | The Power to Serve
> Vote for me for FreeBSD core or the cute little bunny gets it.

-- 
Brian <brian@Awfulhak.org>                    <brian@freebsd-services.com>
      <http://www.Awfulhak.org>;                   <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !          <brian@[uk.]OpenBSD.org>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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