style(9) question

M. Warner Losh imp at bsdimp.com
Thu Mar 2 17:07:55 GMT 2006


In message: <20060302105229.P83093 at atlantis.atlantis.dp.ua>
            Dmitry Pryanishnikov <dmitry at atlantis.dp.ua> 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



More information about the freebsd-current mailing list