From owner-freebsd-hackers@FreeBSD.ORG Fri May 1 11:45:01 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D35A106564A; Fri, 1 May 2009 11:45:01 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id DABE08FC0C; Fri, 1 May 2009 11:45:00 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id n41BMeqw023340; Fri, 1 May 2009 13:22:40 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id n41BMd5u023339; Fri, 1 May 2009 13:22:39 +0200 (CEST) (envelope-from marius) Date: Fri, 1 May 2009 13:22:39 +0200 From: Marius Strobl To: Christoph Mallon Message-ID: <20090501112239.GA23199@alchemy.franken.de> References: <49F4070C.2000108@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49F4070C.2000108@gmx.de> User-Agent: Mutt/1.4.2.3i Cc: FreeBSD Hackers , Roman Divacky , Ed Schouten , Warner Losh , Maxim Sobolev Subject: Re: C99: Suggestions for style(9) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2009 11:45:01 -0000 On Sun, Apr 26, 2009 at 09:02:36AM +0200, Christoph Mallon wrote: > > return with parentheses: > Removed, because it does not improve maintainability in any way. There > is no source for confusion here, so the rule even contradicts the rule, > which states not to use redundant parentheses. Maybe, decades ago it was > just a workaround for a broken compiler, which does not exist anymore. FYI, the idea behind this rule is said to be to able to use a macro return(), f.e. for debugging you then can do: #define return(x) do { \ printf("returning from %s with %d\n", __func__, (x)); \ return (x); \ } while (0) Given the this is a nifty feature and parentheses around the return value don't hurt maintainability in any way IMO this rule should stay. Marius