[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANg8OWK8ee97D+SkR+7DzXdJLsDgViLO3QiAcXsBnU6F_cj5wA@mail.gmail.com>
Date: Sat, 8 Sep 2012 04:24:02 +0300
From: Irina Tirdea <irina.tirdea@...il.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Namhyung Kim <namhyung@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists