Re: [PATCH spice-server 1/2] Change ENABLE_EXTRA_CHECKS statements to #ifdef

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

 



On 15/03/18 14:20, Christophe Fergeau wrote:
> On Tue, Mar 13, 2018 at 10:37:46AM -0300, Eduardo Lima (Etrunko) wrote:
>> On 13/03/18 04:21, Frediano Ziglio wrote:
>>>>
>>>> This patch makes it clear that this is a configure switch and not a
>>>> variable defined somewhere else in the code.
>>>>
>>>
>>> The code is intended that way to make the compiler always parse
>>> these parts. Note that that define is always defined so your code
>>> is not doing what you are intending.
>>
>> I have sent this patch by mistake, but anyway, the fact of it always
>> being defined is true with autotools, but it is not with meson.
>>
>> Do you think it would make sense to have this patch or is it better to
>> keep as is? If the latter, I think it would be better to keep a static
>> variable and change its value according to the define.
> 
> For what it's worth, I tried doing something like what you suggest in
> the past
> https://lists.freedesktop.org/archives/spice-devel/2017-September/039963.html
> but I came to the conclusion that this was not going to work nicely
> https://lists.freedesktop.org/archives/spice-devel/2017-September/039983.html
> I don't fully recall what the problem(s) were though :(
> 

Looks like I missed that discussion, but as there are very few places in
the code that make use of this define, we could make it a static global
to each file that makes the use.

#ifdef ENABLE_EXTRA_CHECKS
static const int extra_checks = 1;
#else
static const int extra_checks = 0;
#endif

And then replace accordingly.

-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko@xxxxxxxxxx
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]