Please make that 8.99 in favour of always evaluating the
argument... almost always.
Assertions should not have side effects -- if you write them right, GCC
will optimise away the expression anyway. (Ignore strings for the moment).
However sometimes you'd *really* like to not evaluate the argument:
occasions when you'd write `kassert (check_complex_condition ())' which
calls a slow, consistency-checking function.
If they're rare putting #ifndef NDEBUG arround those calls is probably
reasonable. Or just test:
kassert (defined_NDEBUG || check_complex_condition ());
enjoy,
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/