diff options
author | Anna Gringauze <annagrin@microsoft.com> | 2018-08-13 07:44:17 +0300 |
---|---|---|
committer | Neil MacIntosh <neilmac@fb.com> | 2018-08-13 07:44:17 +0300 |
commit | cea0d0ac2bd775f0fb4c7e357a089979370ae3cd (patch) | |
tree | faa0e678f606971b55ef795d507d613d40e93de2 /tests/assertion_tests.cpp | |
parent | 6a75903c79ff7109c24d281372005b622a9d9177 (diff) |
fix cppcorecheck warnings (#703)
* Added c++17 test configurations for clang5.0 and clang6.0
* Fixed CppCoreCheck warnings in GSL and tests
- Added CMakeSettings.json for VS Open Folder configuration
- So we can easily run CppCoreCheck in VS
- Fixed CppCorecheck warnings where it made sense
- Suppressed the rest
- Some suppression does not work due to compiler/tool bugs,
so replaced by #pragma disable
- CppCoreCheck has noise, suppressed those with comments
- Catch produces many warnings, blanket-supressed them all
- Had to fix clang formatting to keep attributes in place
- clang-format does not support attributes, so I am using
- "CommentPragmas: '^ NO-FORMAT:'" to skip formatiting on them
- Removed GSL_NOEXCEPT macro, removed incorred noexcepts
* Ignore unknown attributes
* ignore unknown attributes in noexception mode tests
* fixed C26472 in at()
* created GSL_SUPPRESS macro to allow all compilers to parse suppression attributes
* try to fix gcc compilation problems with attributes
* ignore gsl::suppress for gcc
* move suppression to function level on return statements
clang5.0 and up does not allow attributes on return statemets in constexpr functions
* move suppression to function level on return statements
* use GSL_SUPPRESS in algorithm_tests
* Addressed PR comments
Diffstat (limited to 'tests/assertion_tests.cpp')
-rw-r--r-- | tests/assertion_tests.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/assertion_tests.cpp b/tests/assertion_tests.cpp index 25c0089..0c509ad 100644 --- a/tests/assertion_tests.cpp +++ b/tests/assertion_tests.cpp @@ -14,6 +14,12 @@ // /////////////////////////////////////////////////////////////////////////////// +#ifdef _MSC_VER +// blanket turn off warnings from CppCoreCheck from catch +// so people aren't annoyed by them when running the tool. +#pragma warning(disable : 26440 26426) // from catch +#endif + #include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK... #include <gsl/gsl_assert> // for fail_fast (ptr only), Ensures, Expects |