lkml.org 
[lkml]   [2007]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: condingstyle, was Re: utrace comments
Date
From
> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-30 23:37    [W:0.217 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site