cvs commit: src/sys/geom/concat g_concat.c src/sys/geom/label g_label.c src/sys/geom/mirror g_mirror.c src/sys/geom/raid3 g_raid3.c src/sys/geom/stripe g_stripe.c

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Aug 26 12:11:25 PDT 2004


In message <20040826183022.GO77326 at green.homeunix.org>, Brian Fundakowski Feldm
an writes:
>> KASSERT(error == 0 && pp->sectorsize > 0 && pp->mediasize > 0, ("Buggy code."));
>
>I don't like that one bit.

Get used to it :-)

>KASSERT() should be reserved for serious
>programming errors -- guarding against side cases that show major
>error.

That KASSERT does guide against a major error on the part of the
programmer.

In GEOM I have generously sprinkled KASSERTs for the very purpose
of stopping programmer misunderstandings or attempts to be smart.
The intent is that the programmer will find his bugs even during
light testing and that the KASSERTs will help clarify the intentional
use of APIs.

They have been very successful in this respect, and more will be
added as I think them up.

Poul-Henning

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the cvs-src mailing list