diff options
21 files changed, 149 insertions, 12 deletions
diff --git a/doctest/doctest.h b/doctest/doctest.h index e9a1b637..3bbffd68 100644 --- a/doctest/doctest.h +++ b/doctest/doctest.h @@ -205,6 +205,37 @@ DOCTEST_MSVC_SUPPRESS_WARNING(4996) // The compiler encountered a deprecated dec 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(4820) // padding +DOCTEST_MSVC_SUPPRESS_WARNING(4625) // copy constructor was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(4626) // assignment operator was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(5027) // move assignment operator was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(5026) // move constructor was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(4623) // default constructor was implicitly defined as deleted + +// C4668 - 'x' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' +// C4365 - conversion from 'int' to 'unsigned long', signed/unsigned mismatch +// C4774 - format string expected in argument 'x' is not a string literal +// C4820 - padding in structs + +// only 4 should be disabled globally: +// - C4514 # unreferenced inline function has been removed +// - C4571 # SEH related +// - C4710 # function not inlined +// - C4711 # function 'x' selected for automatic inline expansion + +#define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN \ + DOCTEST_MSVC_SUPPRESS_WARNING_PUSH \ + DOCTEST_MSVC_SUPPRESS_WARNING(4668) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4365) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4774) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4820) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4625) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4626) \ + DOCTEST_MSVC_SUPPRESS_WARNING(5027) \ + DOCTEST_MSVC_SUPPRESS_WARNING(5026) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4623) + +#define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END DOCTEST_MSVC_SUPPRESS_WARNING_POP // ================================================================================================= // == FEATURE DETECTION ============================================================================ @@ -3221,9 +3252,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") @@ -3245,6 +3280,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> @@ -3270,6 +3307,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 @@ -3714,6 +3753,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> @@ -3722,6 +3763,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> @@ -3799,6 +3842,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"; @@ -3874,6 +3919,7 @@ namespace detail case assertType::DT_FAST_REQUIRE_UNARY_FALSE: return "FAST_REQUIRE_UNARY_FALSE"; // clang-format on } + DOCTEST_MSVC_SUPPRESS_WARNING_POP return ""; } diff --git a/doctest/parts/doctest_fwd.h b/doctest/parts/doctest_fwd.h index a2ac3bb3..03e15955 100644 --- a/doctest/parts/doctest_fwd.h +++ b/doctest/parts/doctest_fwd.h @@ -202,6 +202,37 @@ DOCTEST_MSVC_SUPPRESS_WARNING(4996) // The compiler encountered a deprecated dec 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(4820) // padding +DOCTEST_MSVC_SUPPRESS_WARNING(4625) // copy constructor was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(4626) // assignment operator was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(5027) // move assignment operator was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(5026) // move constructor was implicitly defined as deleted +DOCTEST_MSVC_SUPPRESS_WARNING(4623) // default constructor was implicitly defined as deleted + +// C4668 - 'x' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' +// C4365 - conversion from 'int' to 'unsigned long', signed/unsigned mismatch +// C4774 - format string expected in argument 'x' is not a string literal +// C4820 - padding in structs + +// only 4 should be disabled globally: +// - C4514 # unreferenced inline function has been removed +// - C4571 # SEH related +// - C4710 # function not inlined +// - C4711 # function 'x' selected for automatic inline expansion + +#define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN \ + DOCTEST_MSVC_SUPPRESS_WARNING_PUSH \ + DOCTEST_MSVC_SUPPRESS_WARNING(4668) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4365) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4774) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4820) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4625) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4626) \ + DOCTEST_MSVC_SUPPRESS_WARNING(5027) \ + DOCTEST_MSVC_SUPPRESS_WARNING(5026) \ + DOCTEST_MSVC_SUPPRESS_WARNING(4623) + +#define DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END DOCTEST_MSVC_SUPPRESS_WARNING_POP // ================================================================================================= // == FEATURE DETECTION ============================================================================ diff --git a/doctest/parts/doctest_impl.h b/doctest/parts/doctest_impl.h index df56b546..76720f52 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 ""; } diff --git a/examples/all_features/assertion_macros.cpp b/examples/all_features/assertion_macros.cpp index a723ffd5..d76430cb 100644 --- a/examples/all_features/assertion_macros.cpp +++ b/examples/all_features/assertion_macros.cpp @@ -2,7 +2,9 @@ #include "header.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <stdexcept> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("normal macros") { int a = 5; diff --git a/examples/all_features/coverage_maxout.cpp b/examples/all_features/coverage_maxout.cpp index cff34512..05b7b1f7 100644 --- a/examples/all_features/coverage_maxout.cpp +++ b/examples/all_features/coverage_maxout.cpp @@ -2,8 +2,10 @@ #include "header.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <ostream> #include <sstream> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END #ifndef DOCTEST_CONFIG_DISABLE diff --git a/examples/all_features/header.h b/examples/all_features/header.h index 099666ba..7f02ac02 100644 --- a/examples/all_features/header.h +++ b/examples/all_features/header.h @@ -3,7 +3,6 @@ #include "doctest.h" // helper for throwing exceptions - template <typename T> int throw_if(bool in, const T& ex) { if(in) diff --git a/examples/all_features/logging.cpp b/examples/all_features/logging.cpp index 2dd05717..4de31ea5 100644 --- a/examples/all_features/logging.cpp +++ b/examples/all_features/logging.cpp @@ -2,7 +2,9 @@ #include "header.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <vector> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("logging the counter of a loop") { std::vector<int> vec; diff --git a/examples/all_features/stringification.cpp b/examples/all_features/stringification.cpp index 58691df1..13e373cb 100644 --- a/examples/all_features/stringification.cpp +++ b/examples/all_features/stringification.cpp @@ -2,11 +2,12 @@ #include "header.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <string> #include <vector> #include <list> - #include <sstream> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END // the standard forbids writing in the std namespace but it works on all compilers namespace std diff --git a/examples/all_features/subcases.cpp b/examples/all_features/subcases.cpp index 430e69b5..cc973ead 100644 --- a/examples/all_features/subcases.cpp +++ b/examples/all_features/subcases.cpp @@ -2,9 +2,11 @@ #include "header.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <iostream> #include <vector> using namespace std; +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("lots of nested subcases") { cout << endl << "root" << endl; diff --git a/examples/all_features/templated_test_cases.cpp b/examples/all_features/templated_test_cases.cpp index 9f680025..5bef14e4 100644 --- a/examples/all_features/templated_test_cases.cpp +++ b/examples/all_features/templated_test_cases.cpp @@ -1,6 +1,8 @@ #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <vector> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END // typedefs are required if variadic macro support is not available (otherwise the commas are a problem) typedef doctest::Types<char, short, int> int_types; diff --git a/examples/exe_with_static_libs/lib_1_src1.cpp b/examples/exe_with_static_libs/lib_1_src1.cpp index 0ce26907..53c97cc4 100644 --- a/examples/exe_with_static_libs/lib_1_src1.cpp +++ b/examples/exe_with_static_libs/lib_1_src1.cpp @@ -1,4 +1,6 @@ #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("asd") { printf("hello from <lib_1_src1.cpp>\n"); } diff --git a/examples/exe_with_static_libs/lib_1_src2.cpp b/examples/exe_with_static_libs/lib_1_src2.cpp index 13ed3906..bef4fdc6 100644 --- a/examples/exe_with_static_libs/lib_1_src2.cpp +++ b/examples/exe_with_static_libs/lib_1_src2.cpp @@ -1,4 +1,6 @@ #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("asd") { printf("hello from <lib_1_src2.cpp>\n"); } diff --git a/examples/exe_with_static_libs/lib_2_src.cpp b/examples/exe_with_static_libs/lib_2_src.cpp index 68c3dadd..84c28a0c 100644 --- a/examples/exe_with_static_libs/lib_2_src.cpp +++ b/examples/exe_with_static_libs/lib_2_src.cpp @@ -1,4 +1,6 @@ #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("asd") { printf("hello from <lib_2_src.cpp>\n"); } diff --git a/examples/executable_dll_and_plugin/dll.cpp b/examples/executable_dll_and_plugin/dll.cpp index 03b70fa4..47587832 100644 --- a/examples/executable_dll_and_plugin/dll.cpp +++ b/examples/executable_dll_and_plugin/dll.cpp @@ -1,7 +1,9 @@ #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("dll") { printf("I am a test from the dll!\n"); diff --git a/examples/executable_dll_and_plugin/implementation.cpp b/examples/executable_dll_and_plugin/implementation.cpp index 1c8464f2..0e468cc1 100644 --- a/examples/executable_dll_and_plugin/implementation.cpp +++ b/examples/executable_dll_and_plugin/implementation.cpp @@ -2,7 +2,9 @@ #define DOCTEST_CONFIG_IMPLEMENT #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("implementation") { printf("I am a test from the implementation!\n"); diff --git a/examples/executable_dll_and_plugin/implementation_2.cpp b/examples/executable_dll_and_plugin/implementation_2.cpp index 69665ec3..9e9cfc37 100644 --- a/examples/executable_dll_and_plugin/implementation_2.cpp +++ b/examples/executable_dll_and_plugin/implementation_2.cpp @@ -1,7 +1,9 @@ // note that DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL should not be defined here #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("implementation_2") { printf("I am a test from the implementation_2!\n"); diff --git a/examples/executable_dll_and_plugin/main.cpp b/examples/executable_dll_and_plugin/main.cpp index ad3b429d..2350791f 100644 --- a/examples/executable_dll_and_plugin/main.cpp +++ b/examples/executable_dll_and_plugin/main.cpp @@ -1,7 +1,9 @@ #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END template<typename T> static int conditional_throw(bool in, const T& ex) { @@ -21,7 +23,9 @@ TEST_CASE("executable") { #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <windows.h> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END #ifdef _MSC_VER #define LoadDynamicLib(lib) LoadLibrary(lib ".dll") #else // _MSC_VER diff --git a/examples/executable_dll_and_plugin/plugin.cpp b/examples/executable_dll_and_plugin/plugin.cpp index 8025a5d3..95ab5c4c 100644 --- a/examples/executable_dll_and_plugin/plugin.cpp +++ b/examples/executable_dll_and_plugin/plugin.cpp @@ -1,7 +1,9 @@ #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL #include "doctest.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <cstdio> +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END TEST_CASE("plugin") { printf("I am a test from the plugin!\n"); diff --git a/scripts/cmake/common.cmake b/scripts/cmake/common.cmake index 7f176cdd..6803710b 100644 --- a/scripts/cmake/common.cmake +++ b/scripts/cmake/common.cmake @@ -112,7 +112,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) add_compiler_flags(-Wnoexcept) endif() - #add_compiler_flags(-Waggregate-return) # GCC 4.8 does not silence this even with "#pragma GCC diagnostic ignored" + + # no way to silence it in the expression decomposition macros: _Pragma() in macros doesn't work for the c++ front-end of g++ + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578 + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69543 + # Also the warning is completely worthless nowadays - http://stackoverflow.com/questions/14016993 + #add_compiler_flags(-Waggregate-return) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) add_compiler_flags(-Wdouble-promotion) @@ -145,7 +150,20 @@ if(MSVC) add_compiler_flags(/std:c++latest) # for post c++14 updates in MSVC add_compiler_flags(/permissive-) # force standard conformance - this is the better flag than /Za add_compiler_flags(/WX) - add_compiler_flags(/W4) # /Wall is too aggressive - even the standard C headers give thousands of errors... + add_compiler_flags(/Wall) # turns on warnings from levels 1 through 4 which are off by default - https://msdn.microsoft.com/en-us/library/23k5d385.aspx + + add_compiler_flags( + /wd4514 # unreferenced inline function has been removed + /wd4571 # SEH related + /wd4710 # function not inlined + /wd4711 # function 'x' selected for automatic inline expansion + # /wd4820 # padding in structs + # /wd4625 # copy constructor was implicitly defined as deleted + # /wd4626 # assignment operator was implicitly defined as deleted + # /wd5027 # move assignment operator was implicitly defined as deleted + # /wd5026 # move constructor was implicitly defined as deleted + # /wd4623 # default constructor was implicitly defined as deleted + ) endif() # add a custom target that assembles the single header when any of the parts are touched diff --git a/scripts/playground/test.cpp b/scripts/playground/test.cpp index 9104485e..043e3be7 100644 --- a/scripts/playground/test.cpp +++ b/scripts/playground/test.cpp @@ -1,4 +1,6 @@ #include "parts/doctest_fwd.h" +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN #include <iostream> using namespace std; +DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END diff --git a/scripts/random_dev_notes.md b/scripts/random_dev_notes.md index dbd877f8..f22b97e7 100644 --- a/scripts/random_dev_notes.md +++ b/scripts/random_dev_notes.md @@ -1,11 +1,8 @@ -static to inline for exception translator registration +rethink static code analisys suppressions - users shouldn't have to use the same flags for code which uses doctest macros/types try to forward declare std::string and specialize the string maker for it or something like that -look into this for making dealing with compiler versions easier -https://github.com/kobalicek/cc_detect/blob/master/cc_detect.h - https://github.com/philsquared/Catch/issues/980 == when making a new release: |