Subject: Re: switch to two-argument KASSERT?
To: None <tech-kern@netbsd.org>
From: Daniel Carosone <dan@geek.com.au>
List: tech-kern
Date: 01/14/2004 17:13:13
--OROCMA9jn6tkzFBc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jan 13, 2004 at 11:04:58PM -0600, David Young wrote:
> I believe that FreeBSD defines the macro like this,
>=20
> #define KASSERT(cond, complaint) if (!(cond)) panic complaint

As already noted elsewhere, I support this - but I'd suggest we use
something slightly different for the macro definition.

Specifically, I'd like to still see the asserted condition embedded in
the message. It saves having to dive into the source to find the
message string, rather than dive in looking for the assertion test as
now, just to get a basic interpretation. It also helps the message
text be simpler and more useful it supplements rather than
"translates" the test - otherwise you can wind up with two
obviously-equivalent forms of the same obscure condition.

Assertion messages are for a developer audience (and only enabled if
DIAGNOSTIC, right?) so they don't need to be too user-friendly by
hiding the condition code.

Again, this comes from experience with the equivalent in Java.

--
Dan.
--OROCMA9jn6tkzFBc
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFABN35EAVxvV4N66cRAlz3AKDzhU34bXPor+0HDL+1koOJzfJ42wCguEUO
/ppfOoD03U0fJ270VPRJLBs=
=iF92
-----END PGP SIGNATURE-----

--OROCMA9jn6tkzFBc--