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/warnless.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/warnless.h') diff --git a/lib/warnless.h b/lib/warnless.h index f6a2d744b..284ea1e75 100644 --- a/lib/warnless.h +++ b/lib/warnless.h @@ -26,6 +26,9 @@ #include /* for curl_socket_t */ #endif +#define CURLX_FUNCTION_CAST(target_type, func) \ + (target_type)(void (*) (void))(func) + unsigned short curlx_ultous(unsigned long ulnum); unsigned char curlx_ultouc(unsigned long ulnum); -- cgit v1.2.3