Re: latest checkpatch

Ingo Molnar
2007-10-18T19:39:45Z

* Andy Whitcroft <apw@shadowen.org> wrote:

> > it's perfectly legitimate, in fact more robust. So if checkpatch.pl
> > wants to make any noise about such constructs it should warn about
> > the _lack_ of curly braces in every multi-line condition block
> > _except_ the only safe single-line statement:
> >
> > if (x)
> > y();
>
> Indeed. We should probabally do more on the indentation checks in
> general. The current direct check for:
>
> if (foo);
> bar();
>
> Could probabally be generalised to look for this kind of error:
>
> if (foo)
> bar();
> baz();
> one();

detecting that would be awesome - it's often the sign of a real bug
because the intent is often to have bar() and baz() in the conditional
block.

Ingo