[neomutt-devel] Quick Vote: Debugging Aids

Pietro Cerutti gahr at gahr.ch
Tue Aug 29 13:46:18 CEST 2017


On Aug 29 17 11:05, Richard Russon wrote:
> VOTE: mutt_debug() macro
>     * Yes
>     * No
>     * Don't know

Yes

> * assert()/bug_on()
> 
> We have lots of checks:
>     if (!ptr)
>         return;
> 
> I propose replacing them with a macro:
>     return_if_fail(ptr);
>     return_val_if_fail(ptr, false);
> 
> With DEBUG enabled, they log the file,line,func,test.
> Otherwise, they just return as normal.
> 
> Note: glibc has a backtrace() function which could be used here.
> 
> VOTE: assert-like macro
>     * Yes
>     * No
>     * Don't know

I don't know. For invariants, I'd just use assert(). If on the other
hand NULL is a valid argument for a function, I don't see the need for
logging it. Are there other use cases I'm missing?

-- 
Pietro Cerutti
gahr at gahr.ch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 890 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20170829/5c318054/attachment.sig>


More information about the neomutt-devel mailing list