From owner-freebsd-current@FreeBSD.ORG Thu Mar 2 17:07:55 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 C798516A425 for ; Thu, 2 Mar 2006 17:07:55 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6147143D5A for ; Thu, 2 Mar 2006 17:07:55 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id k22H60Zr022309; Thu, 2 Mar 2006 10:06:00 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 02 Mar 2006 10:06:08 -0700 (MST) Message-Id: <20060302.100608.80501136.imp@bsdimp.com> To: dmitry@atlantis.dp.ua From: "M. Warner Losh" In-Reply-To: <20060302105229.P83093@atlantis.atlantis.dp.ua> References: <20060302105229.P83093@atlantis.atlantis.dp.ua> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Thu, 02 Mar 2006 10:06:00 -0700 (MST) 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 17:07:55 -0000 In message: <20060302105229.P83093@atlantis.atlantis.dp.ua> Dmitry Pryanishnikov writes: : 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? 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)? No. Debates over style(9) aren't productive. We have what we have, and our energies are better spent fixing real bugs than debating. Heck, we'd be better off contemplating the lint in our belly buttons. It just isn't worth arguing over because there won't be consensus and there's a strong desire to have no churn in the code. Why do it in the first place? It makes it look consisntant with if (foo) or while (foo). return foo; looks inconsistant: keyword (expr); Again, it wasn't worth debating the last 20 times it came up... Warner