Re: [FIXES] 2.1.125

Oliver Xymoron (oxymoron@waste.org)
Sat, 10 Oct 1998 12:10:35 -0500 (CDT)


On Sat, 10 Oct 1998, Adam Sulmicki wrote:

> [btw: can someone explain me why in linux kernel I can't declare var
> inside of the proc, but instead it has to be at beginning of it. I think
> in 'normal' c programs you can do that]

Because you've been writing your 'normal' C programs with a C++ compiler.
In ANSI C, variable declarations must preceed all other statements inside
a given scope. Further, variable initialization is limited to simple
assignments.

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.

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

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