[neomutt-devel] Quick Vote: Debugging Aids

Richard Russon 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...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20170829/cd370ce9/attachment.sig>

More information about the neomutt-devel mailing list