Re: + checkpatch-add-check-for-use-of-sizeof-without-parenthesis.patch added to

From: George Spelvin
Date: Wed Jul 11 2012 - 04:14:18 EST


Unser geliebter Führer schreib:
> sizeof without parenthesis is an abomination, and should never be used.

Huh. I prefer sizeof without parens, like I prefer return without parens.

It actually annoys me when I see someone write

return(0);

Because it's not a function (our language is too low-level to use
continuation-passing style), it's magic syntax.

Sizeof likewise. I tend to use "p = malloc(sizeof *p)" a lot.
It just reads more nicely, to my eyes, than "p = malloc(sizeof(*p))".

If I wanted my code to be cluttered with parens, I'd write it in
Lots of Irritating Silly Parenthese.


Certainly, tha paren-less style is all over the kernel. It's heavily
used in arch/x86/boot, for example.

I guess it's what you're used to.
--
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/