They also give example code
bool add_invalid = ckd_add(&result_add, a, b);
I can see that fits with “most of the time, anything positive means ‘no error’”, for example in malloc, write, read or printf, but these new functions return bool, not int, and the chosen method will require writing a double negation sometimes: if(!add_invalid) { … }
That’s not too bad, but if I were to see if(!ckd_add(&result_add, a, b)) { … }
I would expect that to test for failure, not success.Because of that, I think I would have chosen to return true on success, false on failure. I’m curious as to what arguments led to the choice made.