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.
This commit is contained in:
Vadim Zeitlin
2018-05-29 13:57:30 +02:00
parent cc56eed564
commit ed01fede2e

View File

@@ -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.