From: Douglas B Rupp Date: Mon, 5 Aug 2024 20:17:38 +0000 (-0700) Subject: ada: Incompatible conversion on vxworks in socket.c X-Git-Tag: basepoints/gcc-16~3030 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34ace6d7b63d04d26fe7b190764ede70aaa75f32;p=thirdparty%2Fgcc.git ada: Incompatible conversion on vxworks in socket.c In the vxworks section, a conversion between char* and int is attempted, which results in a warning with gcc. However with clang with is an error. Note also on 64bit targets, there's a size mismatch. gcc/ada/ChangeLog: * socket.c [__vxworks]: Change vxw_h_addr type to long from int, and cast the conversion of char* to vxw_h_addr to avoid warning/error. --- diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c index 75b4288a129e..297d303cef7d 100644 --- a/gcc/ada/socket.c +++ b/gcc/ada/socket.c @@ -266,7 +266,7 @@ __gnat_getservbyport (int port, const char *proto, #elif defined (__vxworks) static char vxw_h_name[MAXHOSTNAMELEN + 1]; static char *vxw_h_aliases[1] = { NULL }; -static int vxw_h_addr; +static long vxw_h_addr; static char *vxw_h_addr_list[2] = { (char*) &vxw_h_addr, NULL }; int @@ -307,7 +307,7 @@ __gnat_gethostbyaddr (const char *addr, int len, int type, return -1; } - vxw_h_addr = addr; + vxw_h_addr = (long) addr; ret->h_name = &vxw_h_name; ret->h_aliases = &vxw_h_aliases;