[PATCH] fix build with gcc-14 on musl

4 views
Skip to first unread message

Qian Yun

unread,
Sep 24, 2024, 6:21:16 AM9/24/24
to fricas-devel
This bug is found by gentoo ci: https://bugs.gentoo.org/937325

This happens on gcc-14 because it catches this type of error,
"-Wincompatible-pointer-types".

This doesn't happen on glibc but on musl because the type
declaration of connect/bind is a bit different.

The error message is bellow and the patch is in attachment.

- Qian


x86_64-pc-linux-musl-gcc -Ino/include -g -fPIC -Lno/lib -shared gmp_wrap.c \
-lgmp -o
/var/tmp/portage/sci-mathematics/fricas-1.3.11-r2/work/fricas-1.3.11/target/x86_64-pc-linux-musl/lib/gmp_wrap.so
sockio-c.c: In function 'connect_to_local_server':
sockio-c.c:761:34: error: passing argument 2 of 'connect' from
incompatible pointer type
[-Wincompatible-pointer-types[https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Wincompatible-pointer-types]]
761 | code = connect(sock->socket, uaddr, sizeof(*uaddr));
| ^~~~~
| |
| struct sockaddr_un *
In file included from
/var/tmp/portage/sci-mathematics/fricas-1.3.11-r2/work/fricas-1.3.11/src/include/com.h:42,
from sockio-c.c:48:
/usr/include/sys/socket.h:386:19: note: expected 'const struct sockaddr
*' but argument is of type 'struct sockaddr_un *'
386 | int connect (int, const struct sockaddr *, socklen_t);
| ^~~~~~~~~~~~~~~~~~~~~~~
fix-gcc-14-musl.patch

Waldek Hebisch

unread,
Nov 29, 2024, 10:20:31 AM11/29/24
to fricas...@googlegroups.com
On Tue, Sep 24, 2024 at 06:21:10PM +0800, Qian Yun wrote:
> This bug is found by gentoo ci: https://bugs.gentoo.org/937325
>
> This happens on gcc-14 because it catches this type of error,
> "-Wincompatible-pointer-types".
>
> This doesn't happen on glibc but on musl because the type
> declaration of connect/bind is a bit different.
>
> The error message is bellow and the patch is in attachment.

OK, please commit.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages