If they have no side-effect, they'll compile to *NO CODE*.
It doesn't matter what kassert does in this case.
> PS: if they do have side-effects, then they are bogus.
They are indeed. Ideally we'd like a GCC __builtin_no_side_effects() to
warn us about expressions with side effects.
Away from the ideal.. assert() has been noted as a cause of subtle bugs
over the years by many folks. Somehow the fact that `assert' is
different from `any_other_function' seems to pass by a programmer's
mental pattern matching.
It's easy to write correct assert() calls.
But it can be damn hard to spot other peoples' bogus ones.
-- 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/