[Opendnssec-develop] About assert()...

Yuri Schaeffer yuri at nlnetlabs.nl
Tue Feb 11 08:58:11 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> But what if something did call it with NULL, there might be a 
> situation where the system is temporarily out of memory or that is 
> was called from an untested code path or some other strange 
> situation.

Not a good argument. You should only use assertions when you are sure
they will _never_ fail whereas you use a regular check if it could
_possibly_ fail.

> Is it then our praxis, our coding standard to have the program just
> die? I’d really hope not.

I'm sorry I am in favour of dying. You might have a point that
some/many assertions need to be revised. But I see no objections of
using asserts where appropriate. It is a debugging tool, it has
nothing to do with error handling.

//Yuri

- -- 
Composed on an actual keyboard: all typos genuine.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlL55iMACgkQI3PTR4mhavhs4wCgncBZJopGyPyTO7SxInOIrXq7
Hb4AoIq2IXopFEzBacp/I+qz891LKzP+
=gQ3Z
-----END PGP SIGNATURE-----



More information about the Opendnssec-develop mailing list