Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Mar 2006 20:11:50 +0200 (EET)
From:      Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: style(9) question
Message-ID:  <20060302200303.N46260@atlantis.atlantis.dp.ua>
In-Reply-To: <20060302163633.H77029@fledge.watson.org>
References:  <20060302105229.P83093@atlantis.atlantis.dp.ua> <20060302163633.H77029@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060302200303.N46260>