Subject: Re: [POWERPC] mark BUG() as noreturn

From: David Howells <[email-masked]>
Date: Thu, 21 Sep 2006 14:23:00 +0100

Jimi Xenidis <[email-masked]> wrote:

> > We finish the BUG() macro with a call to a function marked with  
> > attribute
> > "noreturn" so that the compiler will know that BUG() and BUG_ON()
> > (with a constant, non-zero argument) will not return.
> 
> But BUG() _can_ return, if I have a probe, xmon or kgdb configured it  
> is possible  to play with the state of the world and try to continue/ 
> recover, (xmon "x" command).  IMHO, this is a powerful debugging  
> scenario.

It could be made configurable.

OTOH, it is handy to mark BUG() as not being able to return as that tells the
compiler that it doesn't have to check that the code path through the BUG()
call is complete and this means it can be more relaxed about generating
warnings about potentially unused variables and suchlike.

David