RE: condingstyle, was Re: utrace comments

From: Luck, Tony
Date: Mon Apr 30 2007 - 17:34:43 EST


> I'm a bit lost here. Are we referring to
>
> if (expr) {
> ...
> } else {
> ...
> }
>
> versus
>
> if (expr) {
> ...
> }
> else {
> ...
> }

This one is already covered by Documentation/CodingStyle (with the Justification
that this is the way that K&R do it, so it must be right).

> This is
>
> if (expr1 &&
> expr2)
>
> versus
>
> if (expr1
> && expr2)

This isn't covered ... CodingStyle merely says that long lines
should be broken into "sensible chunks". Perhaps we should add
some words about breaking long lines leaving binary operators
trailing on the end of the line (my preferred style). But the
only examples of this I could find leafing through K&R they
put the binary operator on the start of the continuation line
(could the prophets have been wrong here :-)

-Tony
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/