[getdns-api] getdns_return_t for destroy methods

Simon Perreault simon.perreault at viagenie.ca
Mon Mar 10 10:13:59 MST 2014


Le 2014-03-10 13:04, Paul Hoffman a écrit :
>> What we propose, is to let a getdns_context_destroy, when used from
>> within a callback, return GETDNS_RETURN_GOOD if the
>> library/implementation can deal with it, and GETDNS_RETURN_GENERIC_ERROR
>> if it can not.

The problem with this is that you are proposing to use a run-time
mechanism to fix a compile-time mistake. That's something we usually try
to avoid.

More appropriate IMHO would be to use an assert()-like mechanism that
would only be activated when the appropriate debug macro is enabled. The
very purpose of assert() is to find bugs introduced by programmer mistake.

Simon
-- 
DTN made easy, lean, and smart --> http://postellation.viagenie.ca
NAT64/DNS64 open-source        --> http://ecdysis.viagenie.ca
STUN/TURN server               --> http://numb.viagenie.ca


More information about the getdns-api mailing list