qsort_r break builds on macOS
I'm using apk
on macOS to generate packages. It's broken since commit 1d473e00.
Warning during compilation:
❯ ninja -C build
ninja: Entering directory `build'
[1/6] Compiling C object src/libapk.2.dylib.p/adb.c.o
../src/adb.c:991:79: warning: incompatible pointer types passing 'struct wacmp_param *' to parameter of type 'int (* _Nonnull)(void *, const void *, const void *)' [-Wincompatible-pointer-types]
qsort_r(&arr->obj[ADBI_FIRST], adb_ra_num(arr), sizeof(arr->obj[0]), wacmp, &arg);
^~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:342:22: note: passing argument to parameter '__compar' here
int (* _Nonnull __compar)(void *, const void *, const void *));
^
../src/adb.c:995:81: warning: incompatible pointer types passing 'struct wacmp_param *' to parameter of type 'int (* _Nonnull)(void *, const void *, const void *)' [-Wincompatible-pointer-types]
qsort_r(&arr->obj[ADBI_FIRST], adb_ra_num(arr), sizeof(arr->obj[0]), wadbcmp, &arg);
^~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:342:22: note: passing argument to parameter '__compar' here
int (* _Nonnull __compar)(void *, const void *, const void *));
^
2 warnings generated.
[2/6] Compiling C object src/libapk.a.p/adb.c.o
../src/adb.c:991:79: warning: incompatible pointer types passing 'struct wacmp_param *' to parameter of type 'int (* _Nonnull)(void *, const void *, const void *)' [-Wincompatible-pointer-types]
qsort_r(&arr->obj[ADBI_FIRST], adb_ra_num(arr), sizeof(arr->obj[0]), wacmp, &arg);
^~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:342:22: note: passing argument to parameter '__compar' here
int (* _Nonnull __compar)(void *, const void *, const void *));
^
../src/adb.c:995:81: warning: incompatible pointer types passing 'struct wacmp_param *' to parameter of type 'int (* _Nonnull)(void *, const void *, const void *)' [-Wincompatible-pointer-types]
qsort_r(&arr->obj[ADBI_FIRST], adb_ra_num(arr), sizeof(arr->obj[0]), wadbcmp, &arg);
^~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:342:22: note: passing argument to parameter '__compar' here
int (* _Nonnull __compar)(void *, const void *, const void *));
^
2 warnings generated.
[5/6] Generating symbol file src/libapk.2.dylib.p/libapk.2.dylib.symbols