From dc1df297e3f1d03a36bc7c39cde33b47c8b942a5 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 9 Aug 2017 09:29:44 +0100 Subject: [PATCH] Suppressed some warnings - signed/ unsigned mismatches - virtual destructor on ITransientExpression (even though not needed) --- include/internal/catch_decomposer.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/internal/catch_decomposer.h b/include/internal/catch_decomposer.h index 3182b84a..6889d873 100644 --- a/include/internal/catch_decomposer.h +++ b/include/internal/catch_decomposer.h @@ -14,12 +14,23 @@ #include +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4389) // '==' : signed/unsigned mismatch +#pragma warning(disable:4018) // more "signed/unsigned mismatch" +#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform) +#endif + namespace Catch { struct ITransientExpression { virtual auto isBinaryExpression() const -> bool = 0; virtual auto getResult() const -> bool = 0; virtual void streamReconstructedExpression( std::ostream &os ) const = 0; + + // We don't actually need a virtual destructore, but many static analysers + // complain if it's not here :-( + virtual ~ITransientExpression() = default; }; void formatReconstructedExpression( std::ostream &os, std::string const& lhs, std::string const& op, std::string const& rhs ); @@ -180,4 +191,8 @@ namespace Catch { } // end namespace Catch +#ifdef _MSC_VER +#pragma warning(pop) +#endif + #endif // TWOBLUECUBES_CATCH_DECOMPOSER_H_INCLUDED