Subject: Re: switch to two-argument KASSERT?
To: Perry E. Metzger <perry@piermont.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 01/14/2004 19:32:56
--envbJBWh7q8WU6mo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jan 14, 2004 at 05:49:55PM -0500, Perry E. Metzger wrote:
>=20
> David Young <dyoung@pobox.com> writes:
> > #define KASSERT(cond, complaint) if (!(cond)) panic complaint
>=20
> as has been noted, a do wrapper is noted. I'd also suggest the use of
> a couple of strategic __FILE__ and __LINE__ macros to tell the user
> where in which source file the problem happened. Good examples are
> probably in our /usr/include/assert.h

I'd actually recomend not using __FILE__ and __LINE__. Our panic strings=20
should be (i.e. we should make them) distinct enough to not need it. Also,=
=20
I've worked on a project where we had __FILE__ and __LINE__ in error=20
messages, and it just made them more bloated. __FUNCTION__ was ok on=20
occasion, but I think in general we should just work on having distinct=20
messages.

Take care,

Bill

--envbJBWh7q8WU6mo
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFABgnoWz+3JHUci9cRAp/FAJ9j2rfF42+QWZwQOLwfd/W+EZMrRACghGl9
S4/AAb2Vt1YtI7UKLLiavqQ=
=WEVc
-----END PGP SIGNATURE-----

--envbJBWh7q8WU6mo--