style(9) question
Robert Watson
rwatson at FreeBSD.org
Thu Mar 2 17:07:38 GMT 2006
On Thu, 2 Mar 2006, Colin Percival wrote:
> 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)".
I also find myself doing search and replace on return values more on FreeBSD
source than I do on other source. I.e.: s/return (0)/return (NULL)/ and that
sort of thing. I think I would be less comfortable doing that without the
parens. Again, whether that's just habit or a real reason is hard to say.
Robert N M Watson
More information about the freebsd-current
mailing list