Date: Sun, 10 Feb 2013 18:21:18 +0200 From: Alan Barrett <[email protected]>
I would like to declare kern_assert() as __dead, so that static analysers can understand that code after a failed KASSERT is never executed. However, kern_assert returns without panicing if panicstr != NULL (that is, if a panic has already occurred), so gcc will not allow it to be declared __dead. Couldn't you just define __dead differently depending on whether it is a compiler or a static analyzer processing the code? Obviously, such shenanigans are as a rule a bad idea, but this case seems exceptional.
