Date: Mon, 9 Feb 1998 06:28:20 -0600 From: Richard Wackerbarth <rkw@dataplex.net> To: Eivind Eklund <eivind@yes.no> Cc: Hackers@FreeBSD.ORG Subject: Re: DIAGNOSTICS and DEBUG LOGGING (was Re: cvs commit: src/sys/conf options) Message-ID: <l03130305b104a32d3e25@[208.2.87.4]> In-Reply-To: <19980209130707.03437@follo.net> References: <l03130304b1049a4c285d@[208.2.87.4]>; from Richard Wackerbarth on Mon, Feb 09, 1998 at 05:49:52AM -0600 <Pine.SV4.3.95.980209160831.661B-100000@parkplace.cet.co.jp>; <19980209075127.63680@follo.net> <Pine.SV4.3.95.980209160831.661B-100000@parkplace.cet.co.jp> <19980209091644.21614@follo.net> <l03130304b1049a4c285d@[208.2.87.4]>
next in thread | previous in thread | raw e-mail | index | archive | help
>On Mon, Feb 09, 1998 at 05:49:52AM -0600, Richard Wackerbarth wrote: >I'll try to send a description to the mailing-list, and then I'll >write up a new version if people seem interested. I need to get a >freeware version of it some day, anyway; re-writing it each time I >switch employers is getting a bit tedious... I've been there, too. >#ifdef _ASSERTS ># define ASSERT(X,Y) do {if (!(X)) panic Y;}while(0) >#else ># define ASSERT(X,Y) >#endif > >Notice the support for extra argument, the correct direction for the >assert (an assertion should always be true), and the bracketing to >force correct use of ";", making this a single C-statement after >pre-processing with _ASSERTS both defined and undefined. Yours is definitely a better description. The lines I wrote here were off the top of my head. They should be taken more for "flavour". My real macros are much more complicated because I also have provisions for logging, etc. Assert is just one case. In fact, I rarely look at the macros. They are neatly hidden away and "just work". Richard Wackerbarth 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?l03130305b104a32d3e25>