Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 1997 01:32:28 +0200 (MET DST)
From:      Eivind Eklund <perhaps@yes.no>
To:        Poul-Henning Kamp <phk@FreeBSD.ORG>
Cc:        hackers@FreeBSD.ORG
Subject:   Pre-conditions (was Re: cvs commit: src/sys/nfs nfs_vnops.c)
Message-ID:  <199709152332.BAA25440@bitbox.follo.net>
In-Reply-To: Poul-Henning Kamp's message of Wed, 10 Sep 1997 14:27:41 -0700 (PDT)
References:  <199709102127.OAA23352@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> phk         1997/09/10 14:27:41 PDT
> 
>   Modified files:
>     sys/nfs              nfs_vnops.c 
>   Log:
>   Don't repeat checks done at general level.

On a fairly general level: I'd have changed these to consistency
checks enclosed in #if DEBUG/#endif, and a panic (lacking a good
standardized assert facility; assert() is message-less and thus not
good enough).  I like to make 'each routine its own castle' in
debugging mode, not trusting ANYTHING that is passed in from anywhere.

How is this for other people?  Is that considered unnecessary
cluttering of the sources?  Done correctly, I find it a very good form
of documentation of each functions pre-conditions (and possibly
post-conditions/invariants, but that is much more clutter).

Eivind.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709152332.BAA25440>