[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Bug in checkpatch.pl?
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] Bug in checkpatch.pl? |
Date: |
Fri, 26 Aug 2011 13:53:42 +0100 |
On Fri, Aug 26, 2011 at 11:28 AM, Pavel Borzenkov
<address@hidden> wrote:
> checkpatch.pl correctly reports a warning for the following code:
>
> if (something)
> foo;
> else
> bar;
>
> WARNING: braces {} are necessary for all arms of this statement
> #1: FILE: tmp/a.c:1:
> +if (something)
> [...]
> +else
> [...]
>
>
> But if I modify it as follows, checkpatch.pl doesn't report any
> warning/error:
>
> if (something) {
> foo;
> } else
> bar;
>
> Doesn't QEMU coding style forbid such constructions?
Yes, it is forbidden. The only "exception" is:
if (something) {
foo;
} else if (something_else) {
bar;
}
Looks worth fixing to me.
Stefan