style(9) question

M. Warner Losh imp at bsdimp.com
Thu Mar 2 17:11:23 GMT 2006


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


More information about the freebsd-current mailing list