[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH] configure: Fix atomic64 test for --enable-werror on macO
From: |
Thomas Huth |
Subject: |
Re: [RFC PATCH] configure: Fix atomic64 test for --enable-werror on macOS |
Date: |
Thu, 16 Jul 2020 16:30:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 16/07/2020 16.15, Christian Schoenebeck wrote:
> On Donnerstag, 16. Juli 2020 15:11:01 CEST Thomas Huth wrote:
>> When using --enable-werror for the macOS builders in the Cirrus-CI,
>> the atomic64 test is currently failing, and config.log shows a bunch
>> of error messages like this:
>>
>> config-temp/qemu-conf.c:6:7: error: implicit declaration of function
>> '__atomic_load_8' is invalid in C99
>> [-Werror,-Wimplicit-function-declaration] y = __atomic_load_8(&x, 0);
>> ^
>> config-temp/qemu-conf.c:6:7: error: this function declaration is not a
>> prototype [-Werror,-Wstrict-prototypes]
>
> Well, __atomic_*_8() functions do exist on macOS, but it does not look like
> they are supposed to be 'officially' used.
>
> You can compile sources with these functions, and yes they are linking fine
> despite the warning, but IMO not a good idea to use them, as AFAICS they are
> not defined by any public header file.
>
>> Suppress the warnings to make it pass.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> Not sure whether this is the best way to fix this issue ... thus marked
>> as RFC.
>
> Probably it is better to switch to their official C11 counterpart functions
> for this test, like e.g. __atomic_load() instead of __atomic_load_8(), etc.
> That's what the actual qemu code base is using actually anyway.
Thanks, that sounds like a good idea! I'll have a try when I've got some
spare minutes...
Thomas