> 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
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
On Mon, 2012-09-03 at 03:04 +0300, Irina Tirdea wrote:
> - BUG_ON(gettimeofday(_start, NULL));
> + ret = gettimeofday(_start, NULL);
> + BUG_ON(ret);
Its valid (although admittedly dubious) to have BUG_ON with
side-effects.
The 'right' fix would be something like:
---
On Mon, 2012-09-03 at 03:04 +0300, Irina Tirdea wrote:
- BUG_ON(gettimeofday(tv_start, NULL));
+ ret = gettimeofday(tv_start, NULL);
+ BUG_ON(ret);
Its valid (although admittedly dubious) to have BUG_ON with
side-effects.
The 'right' fix would be something like:
---
On Mon, Sep 3, 2012 at 4:45 AM, Namhyung Kim wrote:
> On Mon, 3 Sep 2012 03:04:32 +0300, Irina Tirdea wrote:
>> From: Irina Tirdea
>>
>> When NDEBUG is defined, the assert macro will be expanded to nothing.
>> Some assert calls used in perf are also including some functionality
>> (e.g. system
On Mon, 3 Sep 2012 03:04:32 +0300, Irina Tirdea wrote:
> From: Irina Tirdea
>
> When NDEBUG is defined, the assert macro will be expanded to nothing.
> Some assert calls used in perf are also including some functionality
> (e.g. system calls), not only validity checks. Therefore, if NDEBUG is
>
From: Irina Tirdea
When NDEBUG is defined, the assert macro will be expanded to nothing.
Some assert calls used in perf are also including some functionality
(e.g. system calls), not only validity checks. Therefore, if NDEBUG is
defined, these functionality will be removed along with the assert.
From: Irina Tirdea irina.tir...@intel.com
When NDEBUG is defined, the assert macro will be expanded to nothing.
Some assert calls used in perf are also including some functionality
(e.g. system calls), not only validity checks. Therefore, if NDEBUG is
defined, these functionality will be removed
On Mon, 3 Sep 2012 03:04:32 +0300, Irina Tirdea wrote:
From: Irina Tirdea irina.tir...@intel.com
When NDEBUG is defined, the assert macro will be expanded to nothing.
Some assert calls used in perf are also including some functionality
(e.g. system calls), not only validity checks. Therefore,
On Mon, Sep 3, 2012 at 4:45 AM, Namhyung Kim namhy...@kernel.org wrote:
On Mon, 3 Sep 2012 03:04:32 +0300, Irina Tirdea wrote:
From: Irina Tirdea irina.tir...@intel.com
When NDEBUG is defined, the assert macro will be expanded to nothing.
Some assert calls used in perf are also including some
10 matches
Mail list logo