Re: CodingStyle question: multiple statements on a single line

From: Lennart Sorensen
Date: Wed Sep 03 2008 - 16:22:37 EST


On Wed, Sep 03, 2008 at 11:38:01AM -0700, Roland Dreier wrote:
> if (a) {
> b;
> }
>
> to
>
> if (a)
> b;
>

Why oh why the kernel do this stupid style?

I hate that. It makes debuging such a pain in the @#$@#$. Anytime you
want to do anything in that area you have to add back the missing '{}'
around the statement, so that you can add debug statements to the
condition.

Stupid stupid stupid!!!

It is so annoying when you accidentally break the code by trying to
debug it by doing:

if (a)
printk("Trying to do b\n");
b;

Usually kernel style makes sense, but this part is stupid, inconsistend
with how any condition with multiple statements is done, and error
prone, especially when trying to debug.

Who's stupid idea was this anyhow?

--
Len Sorensen
--
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/