On Wednesday 04 October 2006 12:43, Andrew Morton wrote:Surely, any debugging that hurts will only really be there
I like assertions personally. If we had something like:
void foo(args)
{
locals;
assert_irqs_enabled();
assert_spin_locked(some_lock);
assert_in_atomic();
assert_mutex_locked(some_mutex);
then we get documentation which is (optionally) checked at runtime - best
of both worlds. Better than doing it in kernel-doc. Automatically
self-updating (otherwise kernels go BUG).
Uhoh! How much is that going to hurt runtime? :) It actually seems to me like this should be doable by static code analysis tools without terribly much pain (in the relative sense of the term). Or am I wrong on this thought?