lkml.org 
[lkml]   [2005]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/19] MUTEX: Introduce simple mutex implementation


On Tue, 13 Dec 2005, Andi Kleen wrote:
>
> Remove -Wdeclaration-after-statement

Please don't.

It's a coding style issue. We put our variable declarations where people
can _find_ them, not in random places in the code.

Putting variables in the middle of code only improves readability when you
have messy code.

Now, one feature that _may_ be worth it is the loop counter thing:

for (int i = 10; i; i--)
...

kind of syntax actually makes sense and is a real feature (it makes "i"
local to the loop, and can actually help people avoid bugs - you can't use
"i" by mistake after the loop).

But I think you need "--std=c99" for gcc to take that.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.258 / U:2.352 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site