From owner-freebsd-hackers Wed Jul 31 07:50:43 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA03941 for hackers-outgoing; Wed, 31 Jul 1996 07:50:43 -0700 (PDT) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA03936 for ; Wed, 31 Jul 1996 07:50:40 -0700 (PDT) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.7.5/CET-v2.1) with SMTP id OAA15102 for ; Wed, 31 Jul 1996 14:50:38 GMT Date: Wed, 31 Jul 1996 23:50:38 +0900 (JST) From: Michael Hancock To: FreeBSD Hackers Subject: Re: kernel assertions (Rev. 1) In-Reply-To: <199607310640.XAA02552@MindBender.HeadCandy.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 30 Jul 1996, Michael L. VanLoon -- HeadCandy.com wrote: > >The REQUIRE2 stuff can replace the > > > >#ifdef DIAGNOSTICS > > if (expr) > > panic(expl); > >#endif > > I prefer asserts to call "Debugger()", rather than "panic()", and > that's how I write my assertion macros. How are you supposed to debug > something if it panics? I'd be happy either way. The point I was trying to make was that REQUIRE2 could replace the "tentative looking" argument checking in the code that often manifests itself in the form above. REQUIRE2 would also hopefully induce people to consistently do simple argument checking, because there is no overhead in the production code. The REQUIRE1 assertions would remove the argument checking that's integrated with the real code, just leaving REAL code. They would then be reinstated at the top where they belong. These are level I checks because obviously the author thought they were important enough to integrate the argument checking logic with the code doing the real work. Let's go for HIGHER QUALITY!!! nuff, said. Regards, Mike Hancock