summaryrefslogtreecommitdiff
path: root/lib/warnless.h
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2018-08-09 17:19:24 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2018-08-11 19:19:03 +0200
commit25d2a1bae7871986eabdbe68dc05c5b6473ad4d7 (patch)
tree5a588c693611fc79f2ff7f3844e3f77ef47ea1c3 /lib/warnless.h
parent2a278fd73573d025e6d5ebde8b10d446c27d6d3f (diff)
downloadcurl-25d2a1bae7871986eabdbe68dc05c5b6473ad4d7.tar.gz
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
Diffstat (limited to 'lib/warnless.h')
-rw-r--r--lib/warnless.h3
1 files changed, 3 insertions, 0 deletions
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 <curl/curl.h> /* 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);