From 26e2302f3b9b23508a8bf82a2d3260f34f9b8383 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 12 Dec 2017 00:34:17 +0200 Subject: [PATCH] Suppress MSVC level 4 warnings --- include/boost/mp11/tuple.hpp | 9 +++++++++ test/construct_from_tuple.cpp | 4 ++++ test/construct_from_tuple_cx.cpp | 7 ++++++- test/mp_replace_at.cpp | 6 +++++- test/tuple_apply.cpp | 4 ++++ test/tuple_apply_cx.cpp | 7 ++++++- test/tuple_for_each.cpp | 6 +++++- test/tuple_for_each_cx.cpp | 7 ++++++- 8 files changed, 45 insertions(+), 5 deletions(-) diff --git a/include/boost/mp11/tuple.hpp b/include/boost/mp11/tuple.hpp index b3221f2..e4ccc61 100644 --- a/include/boost/mp11/tuple.hpp +++ b/include/boost/mp11/tuple.hpp @@ -16,6 +16,11 @@ #include #include +#if defined(BOOST_MSVC) +# pragma warning( push ) +# pragma warning( disable: 4100 ) // unreferenced formal parameter 'tp' +#endif + namespace boost { namespace mp11 @@ -85,4 +90,8 @@ template BOOST_CONSTEXPR F tuple_for_each( Tp && tp, F && f ) } // namespace mp11 } // namespace boost +#if defined(BOOST_MSVC) +# pragma warning( pop ) +#endif + #endif // #ifndef BOOST_TUPLE_HPP_INCLUDED diff --git a/test/construct_from_tuple.cpp b/test/construct_from_tuple.cpp index d56bd3c..fc8938a 100644 --- a/test/construct_from_tuple.cpp +++ b/test/construct_from_tuple.cpp @@ -7,6 +7,10 @@ // http://www.boost.org/LICENSE_1_0.txt +#if defined(_MSC_VER) +#pragma warning( disable: 4244 ) // 'initializing': conversion from 'int' to 'char', possible loss of data +#endif + #include #include #include diff --git a/test/construct_from_tuple_cx.cpp b/test/construct_from_tuple_cx.cpp index 62ea3db..5c557d1 100644 --- a/test/construct_from_tuple_cx.cpp +++ b/test/construct_from_tuple_cx.cpp @@ -1,11 +1,16 @@ -// Copyright 2015 Peter Dimov. +// Copyright 2015 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt + +#if defined(_MSC_VER) +#pragma warning( disable: 4244 ) // 'initializing': conversion from 'int' to 'char', possible loss of data +#endif + #include #include diff --git a/test/mp_replace_at.cpp b/test/mp_replace_at.cpp index faf2289..dfd66e1 100644 --- a/test/mp_replace_at.cpp +++ b/test/mp_replace_at.cpp @@ -1,5 +1,5 @@ -// Copyright 2015, 2017 Peter Dimov. +// Copyright 2015, 2017 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -7,6 +7,10 @@ // http://www.boost.org/LICENSE_1_0.txt +#if defined(_MSC_VER) +#pragma warning( disable: 4804 ) // '>=': unsafe use of type 'bool' in operation +#endif + #include #include #include diff --git a/test/tuple_apply.cpp b/test/tuple_apply.cpp index e178dc8..dc50959 100644 --- a/test/tuple_apply.cpp +++ b/test/tuple_apply.cpp @@ -7,6 +7,10 @@ // http://www.boost.org/LICENSE_1_0.txt +#if defined(_MSC_VER) +#pragma warning( disable: 4244 ) // 'initializing': conversion from 'int' to 'char', possible loss of data +#endif + #include #include #include diff --git a/test/tuple_apply_cx.cpp b/test/tuple_apply_cx.cpp index 2fce51b..40201ac 100644 --- a/test/tuple_apply_cx.cpp +++ b/test/tuple_apply_cx.cpp @@ -1,11 +1,16 @@ -// Copyright 2015 Peter Dimov. +// Copyright 2015 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt + +#if defined(_MSC_VER) +#pragma warning( disable: 4244 ) // 'initializing': conversion from 'int' to 'char', possible loss of data +#endif + #include #include diff --git a/test/tuple_for_each.cpp b/test/tuple_for_each.cpp index c16deb9..a7e9428 100644 --- a/test/tuple_for_each.cpp +++ b/test/tuple_for_each.cpp @@ -1,5 +1,5 @@ -// Copyright 2015 Peter Dimov. +// Copyright 2015 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -7,6 +7,10 @@ // http://www.boost.org/LICENSE_1_0.txt +#if defined(_MSC_VER) +#pragma warning( disable: 4244 ) // 'initializing': conversion from 'int' to 'char', possible loss of data +#endif + #include #include #include diff --git a/test/tuple_for_each_cx.cpp b/test/tuple_for_each_cx.cpp index f6960f6..266fffd 100644 --- a/test/tuple_for_each_cx.cpp +++ b/test/tuple_for_each_cx.cpp @@ -1,11 +1,16 @@ -// Copyright 2015 Peter Dimov. +// Copyright 2015 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt + +#if defined(_MSC_VER) +#pragma warning( disable: 4244 ) // 'initializing': conversion from 'int' to 'char', possible loss of data +#endif + #include #include