At line 1401 in `lib/telnet.c`: ``` event_handle = (WSAEVENT)create_event_func(); ``` I get this warning when compiling with `clang-cl` ver 6: ```bash telnet.c(1401,28): warning: cast from function call of type 'int' to non-matching type 'HANDLE' (aka 'void *') [-Wbad-function-cast] event_handle = (WSAEVENT)create_event_func(); ^~~~~~~~~~~~~~~~~~~ ``` clang-cl is quite correct; a `WSAEVENT` is always 32-bit and `HANDLE` is a `void*` which could be 64-bit wide. A fix is maybe to use another `typedef` for the `WSACreateEvent()` function. Like: ```c typedef WSAEVENT (WINAPI *WSOCK2_EVENT)(void); ... WSOCK2_EVENT create_event_func; ... create_event_func = (WSOCK2_EVENT) GetProcAddress(wsock2, "WSACreateEvent"); ```
Activity
gvanem commentedon Jun 29, 2018
FYI, there is also this similar warning:
bagder commentedon Jun 29, 2018
Can you suggest full patches too, since you have the compiler there to verify that the warnings actually go away... ?
gvanem commentedon Jun 29, 2018
Here is my suggestion:
telnet: fix clang warnings