Fix Wparentheses for GCC

Sadly most versions still cannot properly handle the suppression
via `_Pragma`, so it has to leak to the users when they use older
GCC versions to compile their code
This commit is contained in:
Martin Hořeňovský committed 2020-02-26 16:07:34 +01:00
1 parent 6e270958a2
commit e9caeb7d0b
2 files changed
+11

No files matched your search

+5
View File
@@ -48,6 +48,11 @@
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC)
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
// This only works on GCC 9+. so we have to also add a global suppression of Wparentheses
// for older versions of GCC.
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
_Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
#endif
#if defined(__clang__)