[Opendnssec-develop] About assert()...
Jerry Lundström
jerry at opendnssec.org
Mon Feb 10 10:24:55 UTC 2014
On 10 Feb 2014, at 10:12 , Matthijs Mekking <matthijs at NLnetLabs.nl> wrote:
> I agree that having a lot of assertions is good practice. However, I
> have a hard time of putting them in the right place. Below is an example
> of where I was in doubt, and the ods_log_assert calls do not make sense
> anymore.
If you are in doubt maybe the best way is not to use assert since it will kill the program. It is always better to provide errors that the calling code can handle.
> In this specific case, there may be not anything useful to do for a
> particular zone anymore, but other zones can continue to be signed.
But the asset code here will always be successful since faulty variables are handled in the code above the asserts.
With that in mind the numbers of assert we have in the code base is a bit misleading if there is a lot of cases where the asset code is like this case.
--
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/20140210/6ae3a51d/attachment.bin>
More information about the Opendnssec-develop
mailing list