From owner-cvs-src@FreeBSD.ORG Wed Feb 18 15:36:37 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64EA916A4CF; Wed, 18 Feb 2004 15:36:37 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3253343D2D; Wed, 18 Feb 2004 15:36:37 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (localhost [127.0.0.1]) by ns1.xcllnt.net (8.12.10/8.12.10) with ESMTP id i1INaaOE009692; Wed, 18 Feb 2004 15:36:36 -0800 (PST) (envelope-from marcel@ns1.xcllnt.net) Received: (from marcel@localhost) by ns1.xcllnt.net (8.12.10/8.12.10/Submit) id i1INaZtL009691; Wed, 18 Feb 2004 15:36:35 -0800 (PST) (envelope-from marcel) Date: Wed, 18 Feb 2004 15:36:35 -0800 From: Marcel Moolenaar To: John Baldwin Message-ID: <20040218233635.GA9510@ns1.xcllnt.net> References: <200401192127.i0JLRBL3041817@repoman.freebsd.org> <200402180839.09285.jhb@FreeBSD.org> <20040218174059.GC7878@ns1.xcllnt.net> <200402181414.01381.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200402181414.01381.jhb@FreeBSD.org> User-Agent: Mutt/1.5.5.1i cc: src-committers@FreeBSD.org cc: Bruce Evans cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Poul-Henning Kamp cc: Jun Kuriyama Subject: Re: cvs commit: src/sys/alpha/alpha support.s src/sys/i386/i386 swtch.s src/sys/kern kern_shutdown.c src/sys/sys systm.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2004 23:36:37 -0000 On Wed, Feb 18, 2004 at 02:14:00PM -0500, John Baldwin wrote: *snip* > Thus, you have: > > #define KASSERT(condition) KASSERTL(condition, __FILE__, __LINE__) > #define KASSERTV(condition, ...) KASSERTLV(condition, __FILE__, __LINE__, \ > __VA_ARGS__) > #define KASSERTL(condition, file, line) KASSERTLV(condition, file, line, \ > "%s", __STRING(condition)) > #define KASSERTLV(condition, file, line, ...) do { \ > if (!(condition)) { \ > printf("Assertion \""); \ > printf(__VA_ARGS__); \ > printf("\" failed at %s:%d\n", file, line); \ > } \ > } while(0) > > Even nicer might be to make fixup_filename() from subr_witness.c a global > #ifdef INVARIANTS_SUPPORT and have KASSERTLV() use that (it trims any (../)* > from the front of a filename to improve readability of messages by just > returning a char * pointer farther along in the string). Yes, looks very workable to me (KASSERTLV needs to panic though :-) The only downside is that we need to visit any existing KASSERTs. See also below. > If ASSERT() is preferred to KASSERT() that would certain ease the transition > to the different macros. That's the reason I threw in ASSERT. If KASSERT remains unchanged, then the switch/adoption is much easer because there are no ABI breakages. Other than that, I don't care much if it's called ASSERT or KASSERT. /me says: go for s/MPASS/ASSERT/g... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net