[Alpine-info] qsort Protoype Not Detected Correctly?
Porcelain Mouse via Alpine-info
alpine-info at u.washington.edu
Thu Jan 16 23:55:18 PST 2025
Hello Eduardo & Forum,
Is any one else having problems compiling alpine 2.26 with patch.all,
recently? I get a compiler error, see below.
I think the check for the proper arg types for qsort() in sortf() is not
working correctly. configure determined that 'char' was the right type,
but gcc seems to think it's 'void'. Or, something like that, from what I
understand. If I used CFLAGS=-Wno-incompatible-pointer-types, the build
succeeds. But, that may not be the best solution.
Related?
https://github.com/NixOS/nixpkgs/issues/372699
https://github.com/NixOS/nixpkgs/pull/372785
$ gcc --version
gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)
build error:
...
adrbklib.c: In function ‘sort_addr_list’: adrbklib.c:4705:64: error:
passing argument 4 of ‘qsort’ from incompatible pointer type [-Wincompati ble-pointer-types]
4705 | qsort((qsort_t *)list, (size_t)(p - list), sizeof(char *),
cmp_addr);
|
^~~~~~~~
| |
| int
(*)(const char *, const c har *) In file included from
../include/system.h:42,
from ../pith/headers.h:25, from adrbklib.c:14:
/usr/include/stdlib.h:971:34: note: expected ‘__compar_fn_t’ {aka ‘int
(*)(const void *, const void
*)’} but argument is of type ‘int (*)(const char *, const char *)’
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
adrbklib.c: In function ‘adrbk_sort’: adrbklib.c:4766:77: error: passing
argument 4 of ‘qsort’ from incompatible pointer type [-Wincompati
ble-pointer-types]
4765 | (ab->sort_rule == AB_SORT_RULE_FULL_LISTS) ?
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4766 | cmp_cntr_by_full_lists_last :
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
|
|
int (*)(const ch ar *, const char *)
4767 | (ab->sort_rule == AB_SORT_RULE_FULL) ?
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4768 | cmp_cntr_by_full :
| ~~~~~~~~~~~~~~~~~~
4769 | (ab->sort_rule == AB_SORT_RULE_NICK_LISTS) ?
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4770 | cmp_cntr_by_nick_lists_last :
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4771 | /* (ab->sort_rule == AB_SORT_RULE_NICK) */
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4772 | cmp_cntr_by_nick);
| ~~~~~~~~~~~~~~~~
/usr/include/stdlib.h:971:34: note: expected ‘__compar_fn_t’ {aka ‘int
(*)(const void *, const void
*)’} but argument is of type ‘int (*)(const char *, const char *)’
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
--
PMouse
More information about the Alpine-info
mailing list