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

Jerry Lundström jerry at opendnssec.org
Fri Feb 7 13:45:52 UTC 2014


On 07 Feb 2014, at 14:30 , Yuri Schaeffer <yuri at NLnetLabs.nl> wrote:

> Assertions are meant for things that REALLY never should go wrong. If
> you hit one you've hit a programming mistake. Crash early and often
> I'd say. I would go as far as saying good code has LOTS of assertions.

Instead of dying in the middle of something essentially breaking and corrupting databases and files I’d rather see that the functions return an error and the callers handles that error.

Looking a bit into the code there is a lot of assert that do not make any sense, like this (trunk):

    if (!kl || !key || !key->locator) {
        ods_log_error("[%s] push failed: no list or no key", key_str);
        return ODS_STATUS_ASSERT_ERR;
    }
    ods_log_assert(kl);
    ods_log_assert(key);

Guess its just leftover code, spring cleaning may be in order.

--
Jerry Lundström - OpenDNSSEC Developer
http://www.opendnssec.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 625 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.opendnssec.org/pipermail/opendnssec-develop/attachments/20140207/41e52a26/attachment.bin>


More information about the Opendnssec-develop mailing list