Date: Fri, 18 Jan 2013 18:28:58 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Bruce Evans <brde@optusnet.com.au> Cc: src-committers@FreeBSD.org, Eitan Adler <eadler@FreeBSD.org>, John Baldwin <jhb@FreeBSD.org>, svn-src-all@FreeBSD.org, Xin LI <delphij@FreeBSD.org>, svn-src-head@FreeBSD.org, Pawel Jakub Dawidek <pjd@FreeBSD.org> Subject: Re: svn commit: r245506 - head/bin/pwait Message-ID: <20130118182035.R1209@besplex.bde.org> In-Reply-To: <20130118174501.O1209@besplex.bde.org> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> <CAF6rxg=RBJ280qe=ZAbPYBV-uXcjBYFTqCXP%2Bi_LzpMSi2aHkg@mail.gmail.com> <201301171050.07596.jhb@freebsd.org> <20130117203955.GA1679@garage.freebsd.pl> <20130118174501.O1209@besplex.bde.org>
index | next in thread | previous in thread | raw e-mail
On Fri, 18 Jan 2013, Bruce Evans wrote: > The orignal BSD style guide (/usr/src/admin/style/style) actually says > not to use [non-arbitrary] sequential values to indicate all exit points: > ... > but was changed in FreeBSD to say something quite different: > ... > and then was changed to say something even further removed from the original: > ... > I thought that it was changed to at least mention the Standard but not > very useful EXIT_SUCCESS and EXIT_FAILURE. It should also not disallow > an error code of 2 which is often used for more severe errors. PS: I forgot to mention the NetBSD style guide (/usr/src/share/misc/style). At least the 2005 version of it says: % /* % * Exits should be EXIT_SUCCESS on success, and EXIT_FAILURE on % * failure. Don't denote all the possible exit points, using the % * integers 1 through 127. Avoid obvious comments such as "Exit % * 0 on success.". Since main is a function that returns an int, % * prefer returning from it, than calling exit. % */ % return EXIT_SUCCESS; It's interesting that it covers another point in this thread (of whether to return or exit from main()). I like returning from main(), but don't like requiring it. This and other parts of the NetBSD version also remove the examples and the requirement of spaces around return values. Brucehome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130118182035.R1209>
