halt/reset on assert?

kevin diggs diggskevin38 at gmail.com
Fri Apr 8 03:04:16 EST 2011


On Thu, Apr 7, 2011 at 2:55 AM, Benjamin Herrenschmidt
<benh at kernel.crashing.org> wrote:
> On Wed, 2011-04-06 at 14:01 +0100, Evan Lavelle wrote:
>> #define MY_ASSERT(expr) if(!(expr)) BUG()
>
> Make it
>
> #define MY_ASSERT(expr) do { if .... } while(0)
>
> To ensure it has proper single statement semantics in C.
>
So THAT'S why they do this!!!!!! Now I just have to figure out what
'proper single statement semantics' means!

THANKS!!!

kevin

> Cheers,
> Ben.


More information about the Linuxppc-dev mailing list