From 0a6b8e667bdef4743338791b421202ff9de70ade Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 27 Apr 2020 22:29:28 +0300 Subject: [PATCH 1/2] Add warnings=pedantic to the rest of the lwt tests --- test/Jamfile.v2 | 40 ++++++++++++++++------------ test/lightweight_test_eq_nullptr.cpp | 6 ++++- test/lightweight_test_test.cpp | 14 +++++++++- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index e5e87cd..8df3f07 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -68,26 +68,31 @@ run visit_each_test.cpp ; run get_pointer_test.cpp ; -run lightweight_test_test.cpp ; -run lightweight_test_test.cpp : : : off : lightweight_test_test_no_except ; -run lightweight_test_test2.cpp ; -run lightweight_test_all_with_test.cpp ; -run lightweight_test_lt_le_test.cpp ; -run lightweight_test_gt_ge_test.cpp ; -run lightweight_test_eq_nullptr.cpp ; -run lightweight_test_test3.cpp ; -run lightweight_test_test4.cpp - : : : - pedantic +local pedantic-errors = pedantic msvc:on gcc:on clang:on ; + +run lightweight_test_test.cpp + : : : $(pedantic-errors) ; +run lightweight_test_test.cpp : : : + off $(pedantic-errors) : lightweight_test_test_no_except ; +run lightweight_test_test2.cpp + : : : $(pedantic-errors) ; +run lightweight_test_all_with_test.cpp + : : : $(pedantic-errors) ; +run lightweight_test_lt_le_test.cpp + : : : $(pedantic-errors) ; +run lightweight_test_gt_ge_test.cpp + : : : $(pedantic-errors) ; +run lightweight_test_eq_nullptr.cpp + : : : $(pedantic-errors) ; +run lightweight_test_test3.cpp + : : : $(pedantic-errors) ; +run lightweight_test_test4.cpp + : : : $(pedantic-errors) ; run lightweight_test_test5.cpp - : : : - pedantic - msvc:on - gcc:on - clang:on + : : : $(pedantic-errors) gcc-4.4.7:-Wno-sign-compare ; run-fail lightweight_test_all_eq_test.cpp ; @@ -112,7 +117,8 @@ run-fail lightweight_test_le_fail.cpp ; run-fail lightweight_test_gt_fail.cpp ; run-fail lightweight_test_ge_fail.cpp ; -run lightweight_test_bool.cpp ; +run lightweight_test_bool.cpp + : : : $(pedantic-errors) ; run is_same_test.cpp ; diff --git a/test/lightweight_test_eq_nullptr.cpp b/test/lightweight_test_eq_nullptr.cpp index fb24a5e..b502f93 100644 --- a/test/lightweight_test_eq_nullptr.cpp +++ b/test/lightweight_test_eq_nullptr.cpp @@ -8,8 +8,12 @@ // http://www.boost.org/LICENSE_1_0.txt // -#include +#if defined(_MSC_VER) +# pragma warning( disable: 4100 ) // nullptr_t parameter unrereferenced +#endif + #include +#include int main() { diff --git a/test/lightweight_test_test.cpp b/test/lightweight_test_test.cpp index 47821c1..2880625 100644 --- a/test/lightweight_test_test.cpp +++ b/test/lightweight_test_test.cpp @@ -8,8 +8,14 @@ // http://www.boost.org/LICENSE_1_0.txt // -#include +#if defined(_MSC_VER) +# pragma warning( disable: 4702 ) // unreachable code +# pragma warning( disable: 4530 ) // unwind without /EHsc from +# pragma warning( disable: 4577 ) // noexcept without /EHsc from +#endif + #include +#include struct X { @@ -33,6 +39,12 @@ void f( bool x ) } } +#if defined(__clang__) && defined(__has_warning) +# if __has_warning( "-Wstring-plus-int" ) +# pragma clang diagnostic ignored "-Wstring-plus-int" +# endif +#endif + int main() { int x = 0; From 295b72cbc0e2106f1afff9f1f4e5adef416a4741 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 28 Apr 2020 02:04:29 +0300 Subject: [PATCH 2/2] Disable -Waddress in lightweight_test_test.cpp --- test/lightweight_test_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/lightweight_test_test.cpp b/test/lightweight_test_test.cpp index 2880625..73538b4 100644 --- a/test/lightweight_test_test.cpp +++ b/test/lightweight_test_test.cpp @@ -39,6 +39,10 @@ void f( bool x ) } } +#if defined(__GNUC__) +# pragma GCC diagnostic ignored "-Waddress" +#endif + #if defined(__clang__) && defined(__has_warning) # if __has_warning( "-Wstring-plus-int" ) # pragma clang diagnostic ignored "-Wstring-plus-int"