Skip to content

Failing with incompatible function pointer when building on Mac and using libuv 1.48.0 #544

@uilianries

Description

@uilianries

Greetings! We updating the Conan recipe for getdns on ConanCenterIndex (conan-io/conan-center-index#21389) and when building on Mac M1 with Apple Clang 15, getdns fails to be built in case libuv is enabled (BUILD_LIBUV=ON):

src/extension/libuv.c:214:28: error: incompatible function pointer types passing 'void (uv_timer_t *, int)' (aka 'void (struct uv_timer_s *, int)') to parameter of type 'uv_timer_cb' (aka 'void (*)(struct uv_timer_s *)') [-Wincompatible-function-pointer-types]
                uv_timer_start(my_timer, getdns_libuv_timeout_cb, timeout, 0);

For now, I just ignored it by using -Wno-error=incompatible-function-pointer-types.

Not sure if could be done something directly in the code to be safer.

Environment

Datails

I did not try using all standalone, like downloading getdns source, and consuming libuv from brew, but only using Conan instead. As I'm a maintainer, we avoid applying unofficial patches and follow as closer as possible to the upstream in terms of configuration, to avoid any unexpected behavior.

The libuv Conan recipe that packages it can be found here: https://github.com/conan-io/conan-center-index/blob/master/recipes/libuv/all/conanfile.py. As you can see, there is no big deal in terms of building.

Plus, Conan does not inject Werror, neither or other warning flags.

I'm also capable to reproduce the same error on Linux, using Clang 18 instead.

Steps to reproduce

git clone https://github.com/uilianries/conan-center-index.git
cd conan-center-index/recipes/getdns/all
git checkout 53c2c75
conan create . --version=1.7.3 --build=missing

Sorry for complicating the reproducible scenario. The CMake setup should equivalent to:

cmake -G "Ninja" -DBUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DOPENSSL_USE_STATIC_LIBS="ON" -DENABLE_SHARED="OFF" -DENABLE_STATIC="ON" -DENABLE_STUB_ONLY="ON" -DBUILD_LIBEV="ON" -DBUILD_LIBEVENT2="ON" -DBUILD_LIBUV="ON" -DUSE_LIBIDN2="ON" -DUSE_GNUTLS="OFF" -DFORCE_COMPAT_STRPTIME="ON" -DBUILD_TESTING="OFF" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW"

Build log

Here is my full build log.

getdns-1.7.3-mac-static.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions