diff options
author | onqtam <vik.kirilov@gmail.com> | 2017-10-28 21:30:45 +0300 |
---|---|---|
committer | onqtam <vik.kirilov@gmail.com> | 2017-10-29 16:08:35 +0200 |
commit | abf39d27d76eb8437dc303682fedf1d808bd5906 (patch) | |
tree | 33506d088694480553a86220e4aa19ca2ca767ef /doctest/parts/doctest_impl.h | |
parent | 4059afead1675534184e0e59a558aec059456a6c (diff) |
Visual studio builds now use /Wall instead of /W4 - and only 4 warnings are left disabled globally - fixes #95
Diffstat (limited to 'doctest/parts/doctest_impl.h')
-rw-r--r-- | doctest/parts/doctest_impl.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/doctest/parts/doctest_impl.h b/doctest/parts/doctest_impl.h index df56b54..76720f5 100644 --- a/doctest/parts/doctest_impl.h +++ b/doctest/parts/doctest_impl.h @@ -61,9 +61,13 @@ DOCTEST_MSVC_SUPPRESS_WARNING( DOCTEST_MSVC_SUPPRESS_WARNING(4706) // assignment within conditional expression DOCTEST_MSVC_SUPPRESS_WARNING(4512) // 'class' : assignment operator could not be generated DOCTEST_MSVC_SUPPRESS_WARNING(4127) // conditional expression is constant -DOCTEST_MSVC_SUPPRESS_WARNING( - 4530) // C++ exception handler used, but unwind semantics are not enabled +DOCTEST_MSVC_SUPPRESS_WARNING(4530) // C++ exception handler used, but unwind semantics not enabled DOCTEST_MSVC_SUPPRESS_WARNING(4577) // 'noexcept' used with no exception handling mode specified +DOCTEST_MSVC_SUPPRESS_WARNING( + 4774) // format string expected in argument 'x' is not a string literal +DOCTEST_MSVC_SUPPRESS_WARNING( + 4365) // conversion from 'int' to 'unsigned long', signed/unsigned mismatch +DOCTEST_MSVC_SUPPRESS_WARNING(4820) // padding in structs #if defined(DOCTEST_NO_CPP11_COMPAT) DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat") @@ -85,6 +89,8 @@ DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat-pedantic") } \ } while(false) +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN + // required includes - will go only in one translation unit! #include <ctime> #include <cmath> @@ -110,6 +116,8 @@ DOCTEST_CLANG_SUPPRESS_WARNING("-Wc++98-compat-pedantic") #include <stdint.h> #endif // !MSVC +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END + namespace doctest { namespace detail @@ -554,6 +562,8 @@ extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); #define NOMINMAX #endif // NOMINMAX +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN + // not sure what AfxWin.h is for - here I do what Catch does #ifdef __AFXDLL #include <AfxWin.h> @@ -562,6 +572,8 @@ extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent(); #endif #include <io.h> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END + #else // DOCTEST_PLATFORM_WINDOWS #include <sys/time.h> @@ -639,6 +651,8 @@ namespace detail } const char* getAssertString(assertType::Enum val) { + DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH( + 4062) // enumerator 'x' in switch of enum 'y' is not handled switch(val) { //!OCLINT missing default in switch statements // clang-format off case assertType::DT_WARN : return "WARN"; @@ -714,6 +728,7 @@ namespace detail case assertType::DT_FAST_REQUIRE_UNARY_FALSE: return "FAST_REQUIRE_UNARY_FALSE"; // clang-format on } + DOCTEST_MSVC_SUPPRESS_WARNING_POP return ""; } |