style(9) question
Dmitry Pryanishnikov
dmitry at atlantis.dp.ua
Thu Mar 2 18:12:04 GMT 2006
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 at atlantis.dp.ua
nic-hdl: LYNX-RIPE
More information about the freebsd-current
mailing list