mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-24 14:26:10 +01:00
Suppress -Wunused-result warning in gcc
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425.
This commit is contained in:
parent
689fdcd7dc
commit
535205e2ac
@ -50,6 +50,9 @@
|
|||||||
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
|
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
|
||||||
_Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
|
_Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
|
||||||
|
|
||||||
|
# define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
|
||||||
|
_Pragma( "GCC diagnostic ignored \"-Wunused-result\"" )
|
||||||
|
|
||||||
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
|
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
|
||||||
_Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" )
|
_Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" )
|
||||||
|
|
||||||
@ -365,6 +368,9 @@
|
|||||||
#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
|
#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
|
||||||
# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
|
# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT)
|
||||||
|
# define CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT
|
||||||
|
#endif
|
||||||
#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS)
|
#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS)
|
||||||
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
|
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,6 +90,7 @@
|
|||||||
if( catchAssertionHandler.allowThrows() ) \
|
if( catchAssertionHandler.allowThrows() ) \
|
||||||
try { \
|
try { \
|
||||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||||
|
CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
|
||||||
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
|
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
|
||||||
static_cast<void>(__VA_ARGS__); \
|
static_cast<void>(__VA_ARGS__); \
|
||||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||||
@ -110,6 +111,7 @@
|
|||||||
if( catchAssertionHandler.allowThrows() ) \
|
if( catchAssertionHandler.allowThrows() ) \
|
||||||
try { \
|
try { \
|
||||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||||
|
CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
|
||||||
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
|
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
|
||||||
static_cast<void>(expr); \
|
static_cast<void>(expr); \
|
||||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||||
@ -136,6 +138,7 @@
|
|||||||
if( catchAssertionHandler.allowThrows() ) \
|
if( catchAssertionHandler.allowThrows() ) \
|
||||||
try { \
|
try { \
|
||||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||||
|
CATCH_INTERNAL_SUPPRESS_UNUSED_RESULT \
|
||||||
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
|
CATCH_INTERNAL_SUPPRESS_USELESS_CAST_WARNINGS \
|
||||||
static_cast<void>(__VA_ARGS__); \
|
static_cast<void>(__VA_ARGS__); \
|
||||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||||
|
Loading…
Reference in New Issue
Block a user