Messages in this thread | | | From | Irina Tirdea <> | Date | Sat, 8 Sep 2012 04:24:02 +0300 | Subject | Re: [PATCH] perf bench: fix assert when NDEBUG is defined |
| |
> Its valid (although admittedly dubious) to have BUG_ON with > side-effects. > > The 'right' fix would be something like: > > --- > #ifndef BUG_ON > +#ifdef NDEBUG > +#define BUG_ON(cond) do { if (cond) ; } while (0) > +#else > #define BUG_ON(cond) assert(!(cond)) > #endif > +#endif >
This is indeed the right fix. I will use this approach, test it and resubmit.
Thanks, Irina
| |