From 25d2a1bae7871986eabdbe68dc05c5b6473ad4d7 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Thu, 9 Aug 2018 17:19:24 +0200 Subject: Silence GCC 8 cast-function-type warnings On Windows, casting between unrelated function types is fine and sometimes even necessary, so just use an intermediate cast to (void (*) (void)) to silence the warning as described in [0]. [0] https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html Closes https://github.com/curl/curl/pull/2860 --- lib/telnet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/telnet.c') diff --git a/lib/telnet.c b/lib/telnet.c index 6a144ed3a..031d61f4e 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -1357,7 +1357,9 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) } /* Grab a pointer to WSACreateEvent */ - create_event_func = (WSOCK2_EVENT) GetProcAddress(wsock2, "WSACreateEvent"); + create_event_func = + CURLX_FUNCTION_CAST(WSOCK2_EVENT, + (GetProcAddress(wsock2, "WSACreateEvent"))); if(create_event_func == NULL) { failf(data, "failed to find WSACreateEvent function (%u)", GetLastError()); FreeLibrary(wsock2); -- cgit v1.2.3