Skip to content

Bundled libuv-related bug: fs.c: error: incompatible function pointer types passing 'int (const uv__dirent_t *)' (aka 'int (const struct dirent *)') to parameter of type 'int (*)(struct dirent *)' #1821

Open
@barracuda156

Description

There is a bug in libuv code which affects macOS < 10.8. Since some compilers now err out on incompatible-function-pointer-types, in particular gcc 14 and clang 16, it breaks the build of MoarVM.

/opt/local/bin/clang-mp-16 -c -fno-omit-frame-pointer -fno-optimize-sibling-calls -Werror=vla -O3 -DNDEBUG -Wno-logical-op-parentheses -D_DARWIN_USE_64_BIT_INODE=1  -DMVM_HEAPSNAPSHOT_FORMAT=2 -pipe -Os -I/opt/local/include/libtommath -arch x86_64 -isystem/opt/local/include/LegacySupport -D_GNU_SOURCE -DMVM_TRACING=0 -DMVM_CGOTO=1 -DMVM_BUILD_SHARED  -I3rdparty/libuv/include -I3rdparty/libuv/src -I3rdparty/sha1 -isystem3rdparty/ryu -isystem3rdparty/dynasm -isystem3rdparty/cmp -isystem3rdparty -I/opt/local/include -Isrc -o 3rdparty/libuv/src/unix/fs.o 3rdparty/libuv/src/unix/fs.c
/opt/local/bin/clang-mp-16 -c -fno-omit-frame-pointer -fno-optimize-sibling-calls -Werror=vla -O3 -DNDEBUG -Wno-logical-op-parentheses -D_DARWIN_USE_64_BIT_INODE=1  -DMVM_HEAPSNAPSHOT_FORMAT=2 -pipe -Os -I/opt/local/include/libtommath -arch x86_64 -isystem/opt/local/include/LegacySupport -D_GNU_SOURCE -DMVM_TRACING=0 -DMVM_CGOTO=1 -DMVM_BUILD_SHARED  -I3rdparty/libuv/include -I3rdparty/libuv/src -I3rdparty/sha1 -isystem3rdparty/ryu -isystem3rdparty/dynasm -isystem3rdparty/cmp -isystem3rdparty -I/opt/local/include -Isrc -o 3rdparty/libuv/src/unix/loop-watcher.o 3rdparty/libuv/src/unix/loop-watcher.c
3rdparty/libuv/src/unix/fs.c:478:34: error: incompatible function pointer types passing 'int (const uv__dirent_t *)' (aka 'int (const struct dirent *)') to parameter of type 'int (*)(struct dirent *)' [-Wincompatible-function-pointer-types]
  n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort);
                                 ^~~~~~~~~~~~~~~~~~~~~
/usr/include/dirent.h:129:11: note: passing argument to parameter here
    int (*)(struct dirent *), int (*)(const void *, const void *)) __DARWIN_INODE64(scandir);
          ^
3rdparty/libuv/src/unix/fs.c:478:57: error: incompatible function pointer types passing 'int (const uv__dirent_t **, const uv__dirent_t **)' (aka 'int (const struct dirent **, const struct dirent **)') to parameter of type 'int (*)(const void *, const void *)' [-Wincompatible-function-pointer-types]
  n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort);
                                                        ^~~~~~~~~~~~~~~~~~~
/usr/include/dirent.h:129:37: note: passing argument to parameter here
    int (*)(struct dirent *), int (*)(const void *, const void *)) __DARWIN_INODE64(scandir);
                                    ^

Originally reported in macports/macports-ports#24800

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