Wincompatible-pointer-types triggered when building with clang22 a for armv7 ios
Author: edo9300Created Sep 13, 2026Updated Sep 13, 2026
When building with the combination of clang22, ios 13 sdk and armv7 target, libgit2 fails to build due to size_t being declared as unsigned long, and thus being a mismatched type when passed to the various GIT_XXX_SIZET_OVERFLOW, GIT_ERROR_CHECK_ALLOC_ADD.
This build log is for libgit 1.8.5, but the issue is present in the current master branch as well
/opt/cctools/bin/armv7-iphoneos-clang -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/arm-ios-dbg/src/util -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/arm-ios-dbg/include -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/libgit2 -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/util -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/include -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/deps/llhttp -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/deps/pcre -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/deps/xdiff -I/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/deps/ntlmclient -isystem /home/edo/Documents/osxcross/vcpkg/installed/arm-ios/include -isystem /home/edo/Documents/osxcross/vcpkg/installed/arm-ios/debug/lib/pkgconfig/../../../include -D_GNU_SOURCE -fPIC -fPIC -Werror -Wno-error -Wall -Wextra -Wdocumentation -Wno-documentation-deprecated-sync -Wno-missing-field-initializers -Wmissing-declarations -Wstrict-aliasing -Wstrict-prototypes -Wdeclaration-after-statement -Wshift-count-overflow -Wunused-const-variable -Wunused-function -Wint-conversion -Wc11-extensions -Wformat -Wformat-security -g -D_DEBUG -O0 -std=c99 -isysroot /opt/cctools/SDK/iPhoneOS13.0.sdk -MD -MT src/libgit2/CMakeFiles/libgit2.dir/cache.c.o -MF src/libgit2/CMakeFiles/libgit2.dir/cache.c.o.d -o src/libgit2/CMakeFiles/libgit2.dir/cache.c.o -c /home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/libgit2/cache.c
In file included from /home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/libgit2/cache.c:10:
In file included from /home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/libgit2/repository.h:19:
/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/util/array.h:55:35: error: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'unsigned int *' [-Wincompatible-pointer-types]
55 | if (GIT_MULTIPLY_SIZET_OVERFLOW(&new_size, *asize, 3))
| ^~~~~~~~~
/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/util/git2_util.h:142:32: note: expanded from macro 'GIT_MULTIPLY_SIZET_OVERFLOW'
142 | (git__multiply_sizet_overflow(out, nelem, elsize) ? (git_error_set_oom(), 1) : 0)
| ^~~
/home/edo/Documents/osxcross/vcpkg/buildtrees/libgit2/src/v1.8.5-5ba8f90b56.clean/src/util/integer.h:60:40: note: expanded from macro 'git__multiply_sizet_overflow'
60 | __builtin_umul_overflow(one, two, out)
| ^~~
1 error generated.Source: libgit2/libgit2