From owner-svn-src-all@FreeBSD.ORG Fri Jan 18 07:29:07 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 91E38479; Fri, 18 Jan 2013 07:29:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by mx1.freebsd.org (Postfix) with ESMTP id 147391A7; Fri, 18 Jan 2013 07:29:06 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0I7SwZr009082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Jan 2013 18:28:59 +1100 Date: Fri, 18 Jan 2013 18:28:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans Subject: Re: svn commit: r245506 - head/bin/pwait In-Reply-To: <20130118174501.O1209@besplex.bde.org> Message-ID: <20130118182035.R1209@besplex.bde.org> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> <20130117130740.I1066@besplex.bde.org> <201301171050.07596.jhb@freebsd.org> <20130117203955.GA1679@garage.freebsd.pl> <20130118174501.O1209@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zty1sKHG c=1 sm=1 a=jy4U5xBK6Z8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=0Iti9RnyFakA:10 a=WHtsyqLFiwetzuXcfecA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: src-committers@FreeBSD.org, Eitan Adler , John Baldwin , svn-src-all@FreeBSD.org, Xin LI , svn-src-head@FreeBSD.org, Pawel Jakub Dawidek X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 18 Jan 2013 07:29:07 -0000 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. Bruce