qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH] tci: Fix build regression


From: Peter Maydell
Subject: Re: [Qemu-trivial] [PATCH] tci: Fix build regression
Date: Mon, 4 Apr 2016 22:03:22 +0100

On 4 April 2016 at 21:40, Stefan Weil <address@hidden> wrote:
> Am 04.04.2016 um 20:06 schrieb Sergey Fedorov:
>> On 04/04/16 20:50, Stefan Weil wrote:
>>> -/* Defining NDEBUG disables assertions (which makes the code faster). */
>>> -#if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG)
>>> -# define NDEBUG
>>> +/* Enable TCI assertions only when debugging TCG (and without NDEBUG 
>>> defined).
>>> + * Without assertions, the interpreter runs much faster. */
>>> +#if defined(CONFIG_DEBUG_TCG)
>>> +# define tci_assert(cond) assert(cond)
>>> +#else
>>> +# define tci_assert(cond) (void)0
>>
>> Maybe wrap the "(void)0" into parentheses?

> Maybe. It's not needed for the current code.
> Are there situations where parentheses for this would make a difference?

Not sure, but the POSIX standard specifies brackets for its
NDEBUG version of assert:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html

so it seems safest to follow suit.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]