[lkml]   [2005]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [2.6 patch] drivers/net/smc-mca.c: cleanups

    > > > This comment is applicable to similar changes, also. Use 'const'
    > > > whenever possible.
    > >
    > > does that even have meaning in C? In C++ it does, but afaik in C it
    > > doesn't.
    > Yes it does. Often the variables declared this way will go into the text
    > section which is marked read-only.

    true. Doesn't mean too much for the kernel right now (in kernel space
    not a lot of memory is really read only) though.

    > I've used this technique in a few very
    > small programs to reduce their size (I could strip off both their bss and
    > data sections to save space). Also, I believe that the compiler is able
    > to optimize code using consts, but this is pure speculation, I've not
    > verified it.

    Afaik that's the main difference between C and C++; in C you can still
    change "const" variables... in C++ thats illegal (at least that's what I
    remember and google seems to support somewhat ;)

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

     \ /
      Last update: 2005-03-22 14:10    [W:0.019 / U:9.132 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site