From owner-freebsd-current Fri Jul 7 10:22:20 2000 Delivered-To: freebsd-current@freebsd.org Received: from server.baldwin.cx (server.geekhouse.net [64.81.6.52]) by hub.freebsd.org (Postfix) with ESMTP id 9373F37C1A3 for ; Fri, 7 Jul 2000 10:22:03 -0700 (PDT) (envelope-from john@baldwin.cx) Received: from john.baldwin.cx (root@john.baldwin.cx [192.168.1.18]) by server.baldwin.cx (8.9.3/8.9.3) with ESMTP id KAA85197; Fri, 7 Jul 2000 10:20:21 -0700 (PDT) (envelope-from john@baldwin.cx) Received: (from john@localhost) by john.baldwin.cx (8.9.3/8.9.3) id KAA47676; Fri, 7 Jul 2000 10:21:44 -0700 (PDT) (envelope-from john) Message-Id: <200007071721.KAA47676@john.baldwin.cx> X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20000707064640.A391@dr-evil.shagadelic.org> Date: Fri, 07 Jul 2000 10:21:44 -0700 (PDT) From: John Baldwin To: Jason R Thorpe Subject: Re: _DIAGASSERT() Cc: freebsd-current@FreeBSD.ORG, itojun@iijlab.net Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 07-Jul-00 Jason R Thorpe wrote: > On Fri, Jul 07, 2000 at 07:07:50PM +0900, itojun@iijlab.net wrote: > > > do we still need _DIAGASSERT()? i'm not sure if they are maintained > > any longer... jhb does not seem to have checked the history of it BTW. > > Yes, if Mr. Baldwin had done his homework, rather than make an insulting > and uninformed comment on a public FreeBSD mailing list, he would have > discovered that _DIAGASSERT() performs a very different role than the > standard assert(). That's why it's in the implementation namespace (and > used only in system libraries). I do believe I let my sarcasm exceed the allowable boundary in my e-mail. :( I had noticed that _DIAGASSERT was conditional on _DIAGNOSTIC and that it called __diagassert() rather than __assert(), but failed to dig around enough to ascertain the differences between those functions. > They are designed to catch bugs in non-library code when the library > is specifically compiled to do such checks. We went through all this > before, and it is *inappropriate* for those checks to be ASSERT/assert > for shipped libraries. > > It's *intended* that they expand only when the library is compiled > with -D_DIAGNOSTIC. IOW, a way to enable a subset of assertions w/o having to enable all the normal debugging code I take it then? I can see the benefit in that. > The goal is to improve the quality if NetBSD's userland code. FreeBSD, > if they were smart, would adopt the same mechanism. But as can be shown > by the error message, FreeBSD isn't even doing the basic work like > building with strict prototype checking (which would have caught the > missing _DIAGASSERT() in FreeBSD at compile time, rather than at run-time). By default we do not, no. Although our debugging flags in -current would have caught this had I used them. Regardless, my apologies for allowing my sarcasm to come off much rougher than I intended. > -- > -- Jason R. Thorpe -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message