Source-Changes archive

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

Re: CVS commit: src/sys/ufs/ffs



Luke Mewburn wrote:
On Thu, Dec 25, 2008 at 05:47:47PM -0500, Arnaud Lacombe wrote:
  | btw, don't test pointer truth, do the test against NULL. Setting NULL
  | to something else than 0 would be really fun :/

That doesn't matter; see the following for an explanation:
    http://c-faq.com/null/ptrtest.html

True. But IMHO, it is still preferable to have explicit conditional testing inside KASSERTs for pointer truth, it is more readable. Compare:

        panic: kernel diagnostic assertion "xxx == NULL" failed

to

        panic: kernel diagnostic assertion "xxx" failed

It makes more sense (to me, at least).

Cheers,

--
Jean-Yves Migeon
jean-yves.migeon%espci.fr@localhost



Home | Main Index | Thread Index | Old Index