Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Mar 2006 10:06:08 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        dmitry@atlantis.dp.ua
Cc:        freebsd-current@freebsd.org
Subject:   Re: style(9) question
Message-ID:  <20060302.100608.80501136.imp@bsdimp.com>
In-Reply-To: <20060302105229.P83093@atlantis.atlantis.dp.ua>
References:  <20060302105229.P83093@atlantis.atlantis.dp.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20060302105229.P83093@atlantis.atlantis.dp.ua>
            Dmitry Pryanishnikov <dmitry@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




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