mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-16 10:05:39 +02:00
Improve -Wparentheses supression for gcc
If the gcc version supports `_Pragma` properly, we use that to disable it locally inside assertions. Otherwise we disable it for the entire TU. Fixes #674
This commit is contained in:
@@ -24,6 +24,12 @@
|
||||
#elif defined __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wvariadic-macros"
|
||||
# pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
|
||||
// For newer version we can use __Pragma to disable the warnings locally
|
||||
# if __GNUC__ == 4 && __GNUC_MINOR__ >= 4 && __GNUC_MINOR__ <= 7
|
||||
# pragma GCC diagnostic ignored "-Wparentheses"
|
||||
# endif
|
||||
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wpadded"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user