Re: style(9) question

From: M. Warner Losh <imp_at_bsdimp.com>
Date: Thu, 02 Mar 2006 10:09:22 -0700 (MST)
In message: <4407226D.3050901_at_freebsd.org>
            Colin Percival <cperciva_at_freebsd.org> writes:
: Robert Watson wrote:
: > I can't really think of a good reason
: > for return (foo) over return foo
: 
: I'm not sure if this qualifies as a *good* reason, but
: writing "return (foo)" is more consistent with other
: keyword usage: "if (foo)", "for (foo)", "while (foo)",
: "switch (foo)".

Before 'void' existed, many people recommended () so that you could
make 'return' a macro for extra debugging.  With void functions that
have naked returns make this impossible these days...

Warner
Received on Thu Mar 02 2006 - 16:11:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:53 UTC