From owner-freebsd-hackers Mon Sep 15 16:32:45 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA03134 for hackers-outgoing; Mon, 15 Sep 1997 16:32:45 -0700 (PDT) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA03122; Mon, 15 Sep 1997 16:32:40 -0700 (PDT) Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id BAA25440; Tue, 16 Sep 1997 01:32:28 +0200 (MET DST) Date: Tue, 16 Sep 1997 01:32:28 +0200 (MET DST) Message-Id: <199709152332.BAA25440@bitbox.follo.net> From: Eivind Eklund To: Poul-Henning Kamp CC: hackers@FreeBSD.ORG In-reply-to: Poul-Henning Kamp's message of Wed, 10 Sep 1997 14:27:41 -0700 (PDT) Subject: Pre-conditions (was Re: cvs commit: src/sys/nfs nfs_vnops.c) References: <199709102127.OAA23352@freefall.freebsd.org> Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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.