Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 1998 10:59:38 -0500 (EST)
From:      Thomas David Rivers <rivers@dignus.com>
To:        eivind@FreeBSD.ORG, michaelh@cet.co.jp
Cc:        Hackers@FreeBSD.ORG
Subject:   Re: DIAGNOSTICS and DEBUG LOGGING (was Re: cvs commit: src/sys/conf options)
Message-ID:  <199802101559.KAA05589@lakes.dignus.com>

next in thread | raw e-mail | index | archive | help
> 
> On Mon, Feb 09, 1998 at 03:23:45PM +0900, Michael Hancock wrote:
> > Eivind,
> > 
> > I'd like to see "sanity checks" (assertions) and diagnostic logging
> > separated.  DIAGNOSTICS turns on both, but I'd like to be able to run an
> > assertion checking kernel without all the logging. 
> 
> Absolutely agreed.  I was thinking of
> 
> _INVARIANTS	- Enable invariant/postcondition checking (expensive)
> _ASSERTS	- Enable precondition and other cheap assertions
> INVARIANT_CODE	- Compile in invariant functions.
> DIAGNOSTIC	- Messages to help tracing errors; non-overwhelming amount.
> 
> The difference between _INVARIANTS and INVARIANT_CODE is that INVARIANT_CODE
> just includes the actual code necessary to be able to check an invariant,
> while _INVARIANTS actually throw in the code that do calls to check the
> invariant.
> 
> The reason for the underscores is that header files are likely to depend on
> those options.  The separation of the INVARIANT_CODE and _INVARIANTS is to
> be able to support enabling invariant-checks in only some files.  Separation
> of _INVARIANTS and _ASSERTS is that there is often a factor of >1000
> difference between the cost of checking pre-conditions and the cost of
> checking post-conditions/data-structure invariants.

 One quick comment - ANSI C reserves names which begin with an 
underscore followed by a capital letter.  It's possible (albeit
unlikely) that a future C compiler would warn, or produce errors
for these.    Just an observation.

	- Dave Rivers -

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe hackers" in the body of the message



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