lkml.org 
[lkml]   [1998]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [FIXES] 2.1.125
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/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.110 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site