Am 13.08.2012 12:27, schrieb Wenchao Xia:
> 于 2012-8-10 18:48, Paolo Bonzini 写道:
>> Il 09/08/2012 12:12, Wenchao Xia ha scritto:
>>> +        assert(0 == set_option_parameter_int(param,
>>> +                                BLOCK_OPT_SIZE, o_cow->virt_size));
>>
>> Assertions should not have side effects.
>>
>    what side effects would this line have?

It sets some BLOCK_OPT_SIZE parameter. :)

What Paolo probably meant is to extract that part from the assert():
ret = set_option_...(...);
assert(ret == 0);
eliminating the kraxelism at the same time. ;)
Then you can more safely do, e.g., #define assert(x) do {} while (0)

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

Reply via email to