[lkml]   [1998]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [FIXES] 2.1.125

    On Mon, 12 Oct 1998, Mathew G Monroe wrote:

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

    I think it is bad programming practice to declare variable in such a
    manner. It makes variable declaration harder to track if anything. What
    next? Dynamic deallocation in the middle of a proc using delete? Isn't
    that C++ as well <cough>.

    C was designed and is rigid for good reason, please don't tell me some
    committee has decided that variable declarations can happen anywhere in a
    C script. "ugh"

    ----------- Developer and Network/Systems Engineer
    ----- ely - Agape Specialty Products, Phoenix AZ
    ----------- <>

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:45    [W:0.021 / U:11.320 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site