[POWERPC] mark BUG() as noreturn

David Howells dhowells at redhat.com
Thu Sep 21 23:23:00 EST 2006


Jimi Xenidis <jimix at watson.ibm.com> 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



More information about the Linuxppc-dev mailing list