在 2023/11/25 7:56, Oleg Tolmatcev 写道:
Socket.cpp:762:5: warning: comparison of integers of different signs: 'SOCKET' (aka 'unsigned long long') and 'const s32' (aka 'const int') [-Wsign-compare] 762 | FD_SET(fd, &write_fds); | ^~~~~~~~~~~~~~~~~~~~~~ C:/msys64/clang64/include/psdk_inc/_fd_types.h:77:40: note: expanded from macro 'FD_SET' 77 | if (((fd_set *)(set))->fd_array[__i] == (fd)) { \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~This happens because on Windows a socket is unsigned and on Linux it is signed and this is cross platform code.
I don't think the patch is necessary. Windows socket handles are represented as `UINT_PTR` instead of plain `int`. On 64-bit Windows, storing a socket handle into `int` might cause truncation and is not safe.
-- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
