From owner-freebsd-current@FreeBSD.ORG Thu Mar 2 20:55:02 2006 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1611E16A420 for ; Thu, 2 Mar 2006 20:55:02 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4BF643D49 for ; Thu, 2 Mar 2006 20:55:01 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.13.0/8.13.0) with ESMTP id k22KssuE015817; Thu, 2 Mar 2006 15:54:55 -0500 Mime-Version: 1.0 Message-Id: In-Reply-To: <20060302105229.P83093@atlantis.atlantis.dp.ua> References: <20060302105229.P83093@atlantis.atlantis.dp.ua> Date: Thu, 2 Mar 2006 15:54:53 -0500 To: Dmitry Pryanishnikov From: Garance A Drosehn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) on 128.113.2.3 Cc: freebsd-current@FreeBSD.org Subject: Re: style(9) question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2006 20:55:02 -0000 At 11:06 AM +0200 3/2/06, Dmitry Pryanishnikov wrote: >Hello! > > I apologize for asking here my question (it should belong to >-questions, but the most developers are available here, and I >just hope it won't hurt). What's the historical reason of the >following style(9) advise: > > Values in return statements should be enclosed in parentheses. > >What's the rationale of this? Let's say you are debugging a routine which has a dozen different return statements. If they all have the form 'return (blah)', then you can easily #define a return(x) macro which could print out some debugging information before returning. Or maybe add one extra check before returning, in order to catch where some error-situation first showed up. (that check might need to reference other variables inside the routine you are debugging, in which case the check would have to be done in the routine itself, and not in some calling routine). You asked for some rationale, and that is a rationale. It may not even be the right rationale. The fact that I mentioned it does not mean that I plan to join any debate about it. What is in style(9) are recommendations which have *already* been agreed upon. We're not going to re-open debate on those recommendations every time some new person reads the man page. We cannot afford the amount of time and energy which would be wasted. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA