Re: [FIXES] 2.1.125

Matthias Andree (mandree@sx1.HRZ.Uni-Dortmund.DE)
Sun, 11 Oct 1998 23:47:49 +0200


On Sat, Oct 10, 1998 at 12:10:35PM -0500, Oliver Xymoron wrote:
> This is one of the few features of C++ that would apply well to the
> kernel, I think - there are numerous multiple-page functions that could be
> clarified by local declarations. The kernel already heavily relies on
> inline functions, which are standard in C++ but not in C.

Virtually every C compiler supports function inlining as a special
extension, but there are not too many that do support local
declarations - that have their traps anyways, like in:

for(int i = 0; i < 99; i++)
for(int j = 0; i < 99; j++) if (i == j) do_nonsense(i,j);

i remains declared, j doesn't.

You CAN however do local declarations but just placing braces { }
somewhere, or include local declarations at the beginning of a loop
or conditional block like in if (i < 2) { int j; do_something(&j); }

-- 
Matthias Andree

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