[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1415039957.17743.29.camel@perches.com>
Date: Mon, 03 Nov 2014 10:39:17 -0800
From: Joe Perches <joe@...ches.com>
To: Josh Triplett <josh@...htriplett.org>
Cc: Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] CodingStyle: Add a chapter on conditional compilation
On Mon, 2014-11-03 at 10:05 -0800, Josh Triplett wrote:
> On Mon, Nov 03, 2014 at 09:47:40AM -0800, Joe Perches wrote:
[]
> "don't put an else after an if condition
> ending with break or return;
Maybe that's a bit _too_ simple.
Yes for a simple if, but not necessarily an else if
if (foo) {
...;
} else if (bar) {
more code...;
return;
} else {
...
}
still needs that last else.
checkpatch isn't very good at that code flow
interpretation so it emits a warning anyway.
> > Another thing that could go is the suggestion to
> > use Lindent.
> >
> > https://lkml.org/lkml/2013/2/11/390
>
> Agreed completely. We might consider coming up with settings for
> clang-format, which seems like a far more capable replacement that
> actually understands C.
Never used it.
It does seem to have a large number of options
(including a trivial linux-kernel style) though.
http://clang.llvm.org/docs/ClangFormatStyleOptions.html
Dunno how much work it would be to create a proper
linux-kernel style for clang-format.
It might work well, it might not.
Anyone have experience with it?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists