From owner-freebsd-current@FreeBSD.ORG Thu Mar 2 18:12:04 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 0C5B416A422; Thu, 2 Mar 2006 18:12:04 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from postman.atlantis.dp.ua (postman.atlantis.dp.ua [193.108.47.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45D0F43D49; Thu, 2 Mar 2006 18:12:02 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from smtp.atlantis.dp.ua (smtp.atlantis.dp.ua [193.108.46.231]) by postman.atlantis.dp.ua (8.13.1/8.13.1) with ESMTP id k22IBoxI050048; Thu, 2 Mar 2006 20:11:50 +0200 (EET) (envelope-from dmitry@atlantis.dp.ua) Date: Thu, 2 Mar 2006 20:11:50 +0200 (EET) From: Dmitry Pryanishnikov To: Robert Watson In-Reply-To: <20060302163633.H77029@fledge.watson.org> Message-ID: <20060302200303.N46260@atlantis.atlantis.dp.ua> References: <20060302105229.P83093@atlantis.atlantis.dp.ua> <20060302163633.H77029@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 18:12:04 -0000 Hello! On Thu, 2 Mar 2006, Robert Watson wrote: >> Values in return statements should be enclosed in parentheses. >> >> What's the rationale of this? From time to time I see small commits just >> changing "return foo;" -> "return (foo);". I think the first form is quite >> natural and not ambiguous. Shouldn't we remove this advise from style(9)? > > Regarding the contents of style(9) -- generally, we try hard not to change > the style guide, as style proves to be a rather contentious topic, as it is > typically guided much more by opinion and taste than function. Often, > ambiguities in the style guide are resolved by looking at what "most" cases > in the kernel tree currently do, then documenting that as the right way to do > it. I can't really think of a good reason for return (foo) over return foo, > but changing it will just make a bunch of code that previously conformed to > the style guide cease to do so, which probably doesn't really improve matters > :-). No, I don't propose to recommend "return foo;" over "return (foo);". But how about removing this advise completely, making those forms equally conformant? Sincerely, Dmitry -- Atlantis ISP, System Administrator e-mail: dmitry@atlantis.dp.ua nic-hdl: LYNX-RIPE