Re: BUGed to death

From: Roman Zippel (zippel@linux-m68k.org)
Date: Tue Apr 15 2003 - 08:01:09 EST


Hi,

On Tue, 15 Apr 2003, Jens Axboe wrote:

> > What happens if you just turn BUG_ON into "do {} while (0)"?
>
> If you do that, you must audit every single BUG_ON to make sure the
> expression doesn't have any side effects.
>
> BUG_ON(do_the_good_stuff());

This should avoid the problem:

#define BUG_ON(cond) do { if (cond); } while (0)

bye, Roman

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 15 2003 - 22:00:35 EST