I'd consider not changing assert(0)->abort()
if there is code after the assert that looks like an attempt at recovering.
Example:

    if (!p) {
        printf ("the impossible has happened!");
        assert (0);
    }

    return p->q;

  should be changed to abort, while

    if (!p) {
        printf ("the impossible has happened!");
        assert (0);
        return 0;
    }

    return p->q;

  should not.

Why not? According to manual page, assert(x) is equal to if (!x) abort().
As I mentioned earlier, system emulators don't handle SIGABRT

... which won't be generated if !NDEBUG. Only if the recovery code makes sense, of course. However, my point was that those cases where there is recovery code are not no-brainers.

Paolo


Reply via email to