[neomutt-devel] Quick Vote: Debugging Aids
rich at flatcap.org
Tue Aug 29 14:23:10 CEST 2017
> > VOTE: assert-like macro
> I don't know. For invariants, I'd just use assert().
As assert() kills the program, there are only a few places it would be
appropriate, e.g. malloc() failure.
> If on the other hand NULL is a valid argument for a function
> I don't see the need for logging it.
These would be handled separately. I only propose changing the tests
for pointers that we are about to dereference. And only at the beginning
of a function.
> Are there other use cases I'm missing?
Often, the user only notices something's gone wrong after several things
have quietly gone wrong. Adding this logging (DEBUG only) might help us
see some of the earlier failures that led to the reported bug.
In an ideal world, these tests would never be triggered :-)
Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: not available
More information about the neomutt-devel