From ed01fede2e1d3b809d60275518dcb2f869aaa36c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 May 2018 13:57:30 +0200 Subject: [PATCH] Add helper macros for suppressing gcc 8 -Wcast-function-type These warnings are unavoidable in a few places, and testing for gcc version and suppressing them is too verbose, so define helper macros making it a bit less painful. --- include/wx/defs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/wx/defs.h b/include/wx/defs.h index d483bf87dd..909aade4d5 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -667,6 +667,17 @@ typedef short int WXTYPE; # define wxGCC_WARNING_RESTORE(x) #endif +/* Specific macros for -Wcast-function-type warning new in gcc 8. */ +#if wxCHECK_GCC_VERSION(8, 0) + #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() \ + wxGCC_WARNING_SUPPRESS(cast-function-type) + #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() \ + wxGCC_WARNING_RESTORE(cast-function-type) +#else + #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() + #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() +#endif + /* Macros to suppress and restore clang warning only when it is valid.