[Swan-dev] extra guards

Paul Wouters paul at nohats.ca
Mon Jul 14 04:15:28 EEST 2014


On Sat, 12 Jul 2014, D. Hugh Redelmeier wrote:

> There's a lot of code like this at the start of functions:
>        if (st == NULL)
> 		return;
> in places where it should not be needed.

If only we had an automated tool to find these and clean these up :/

> If it should not be needed, it should be left out.  That way we'll crash
> when something goes wrong, rather than bumbling forward.

Note in the past, I've also added a few too many passert() calls before
potential dereferences which should also be removed.

Paul


More information about the Swan-dev mailing list