tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: marking kern_assert(9) as __dead, and recursive panics



   Date: Sun, 10 Feb 2013 18:21:18 +0200
   From: Alan Barrett <apb%cequrux.com@localhost>

   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.


Home | Main Index | Thread Index | Old Index