Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Mar 2006 00:10:31 +0200 (EET)
From:      Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
To:        Garance A Drosehn <gad@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: style(9) question
Message-ID:  <20060302235032.B30476@atlantis.atlantis.dp.ua>
In-Reply-To: <p0623090ec02cf38b9263@[128.113.24.47]>
References:  <20060302105229.P83093@atlantis.atlantis.dp.ua> <p0623090ec02cf38b9263@[128.113.24.47]>

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

Hello!

On Thu, 2 Mar 2006, Garance A Drosehn wrote:
>> following style(9) advise:
>>
>>    Values in return statements should be enclosed in parentheses.
>> 
>> What's the rationale of this?
>
> Let's say you are debugging a routine which has a dozen different
> return statements.  If they all have the form 'return (blah)',
> then you can easily #define a return(x) macro which could print
> out some debugging information before returning.  Or maybe add
> one extra check before returning, in order to catch where some
> error-situation first showed up.  (that check might need to
> reference other variables inside the routine you are debugging,
> in which case the check would have to be done in the routine
> itself, and not in some calling routine).

  Thank you very much. That's actually explains what those extra ()'s
are for. Maybe this even worth mentioning in style(9) in order to prevent
questions like mine.

> You asked for some rationale, and that is a rationale.  It may
> not even be the right rationale.  The fact that I mentioned it
> does not mean that I plan to join any debate about it.  What is
> in style(9) are recommendations which have *already* been agreed
> upon.  We're not going to re-open debate on those recommendations
> every time some new person reads the man page.  We cannot afford
> the amount of time and energy which would be wasted.

  What I didn't expect is that my simple question will get such an
emotional reply. I'm sorry if I've hurt someone, I just want to know more.

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?20060302235032.B30476>