From: Alexandre Oliva <ol...@adacore.com> GCC 14 is stricter about type conversions. Taking the address of an array and decaying the array to a pointer to its first element yield the same address, but the types are no longer considered compatible. The socket data structures want decayed pointers rather than addresses of arrays, so drop the '&'s.
gcc/ada/ChangeLog: * socket.c [__vxworks] (__gnat_gethostbyname): Drop excess '&'. (__gnat_gethostbyaddr): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/socket.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index 77bdde40a24..a22ed993862 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -280,10 +280,10 @@ __gnat_gethostbyname (const char *name, return -1; } ret->h_name = name; - ret->h_aliases = &vxw_h_aliases; + ret->h_aliases = vxw_h_aliases; ret->h_addrtype = AF_INET; ret->h_length = 4; - ret->h_addr_list = &vxw_h_addr_list; + ret->h_addr_list = vxw_h_addr_list; return 0; } @@ -302,18 +302,18 @@ __gnat_gethostbyaddr (const char *addr, int len, int type, return -1; } - if (hostGetByAddr (*(int*)addr, &vxw_h_name) != OK) { + if (hostGetByAddr (*(int*)addr, vxw_h_name) != OK) { *h_errnop = __gnat_get_h_errno (); return -1; } vxw_h_addr = (long) addr; - ret->h_name = &vxw_h_name; - ret->h_aliases = &vxw_h_aliases; + ret->h_name = vxw_h_name; + ret->h_aliases = vxw_h_aliases; ret->h_addrtype = AF_INET; ret->h_length = 4; - ret->h_addr_list = &vxw_h_addr_list; + ret->h_addr_list = vxw_h_addr_list; return 0; } -- 2.43.0