Re: [FIXES] 2.1.125

Mathew G Monroe (mmex+@andrew.cmu.edu)
Mon, 12 Oct 1998 21:27:02 -0400 (EDT)


Excerpts from internet.computing.linux-kernel: 10-Oct-98 Re: [FIXES]
2.1.125 by Oliver Xymoron@waste.org
> > [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.

C9X drafts have included this feature for quite some time. So hopeful
sometime next year when C9X becomes standard this can be used. Now that
brings up a question, what do people thing about using it?

Matt Monroe

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