lkml.org 
[lkml]   [2003]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: BUGed to death
On Tue, Apr 15 2003, Roman Zippel wrote:
> 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)

Yes I'm aware of the problem being fixable, the above is not likely to
be fast than BUG_ON(). My point was just that you cannot simply count on
being able to make BUG_ON a noop, some thought has to go into it.

--
Jens Axboe

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:34    [from the cache]
©2003-2011 Jasper Spaans