Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: xsrc/external/mit/libpciaccess/dist/src

On Nov 4, 2012, at 2:26 AM, David Laight wrote:

> Personally I almost never mark variables 'const', the only I initialise
> in their declarations (at the top of a function) are probably almost
> always never chaned (well maybe execpt default error values).

Personally, I always mark variable as const if I don't expect its value to 
change since that documents that expectation.  This is especially true for 

        const struct foo_softc * const sc = ifp->if_softc;

Once nice side effect is that it catches errors like:

        if (sc = NULL) {

Home | Main Index | Thread Index | Old Index