diff --git a/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp b/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp index 88cf159e0..025cd46a4 100644 --- a/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp +++ b/include/boost/numeric/odeint/algebra/algebra_dispatcher.hpp @@ -22,6 +22,21 @@ #include #include +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif + #include #include @@ -104,6 +119,15 @@ struct algebra_dispatcher< std::array< T , N > > } } } +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + + #endif diff --git a/include/boost/numeric/odeint/algebra/detail/for_each.hpp b/include/boost/numeric/odeint/algebra/detail/for_each.hpp index 5387a47db..27cf62205 100644 --- a/include/boost/numeric/odeint/algebra/detail/for_each.hpp +++ b/include/boost/numeric/odeint/algebra/detail/for_each.hpp @@ -23,6 +23,10 @@ namespace numeric { namespace odeint { namespace detail { +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuninitialized" +#endif template< class Iterator1 , class Operation > inline void for_each1( Iterator1 first1 , Iterator1 last1 , Operation op ) @@ -155,6 +159,9 @@ namespace detail { op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ , *first13++ , *first14++ , *first15++ ); } +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif } // detail } // odeint diff --git a/include/boost/numeric/odeint/algebra/multi_array_algebra.hpp b/include/boost/numeric/odeint/algebra/multi_array_algebra.hpp index f0ae30e4f..8d3d17104 100644 --- a/include/boost/numeric/odeint/algebra/multi_array_algebra.hpp +++ b/include/boost/numeric/odeint/algebra/multi_array_algebra.hpp @@ -18,6 +18,23 @@ #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED #define BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#elif defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif #include @@ -142,5 +159,12 @@ struct algebra_dispatcher< boost::multi_array< T , N > > } // namespace numeric } // namespace boost +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED diff --git a/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp b/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp index f3edce198..4b8f6b1fa 100644 --- a/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp @@ -19,6 +19,20 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED +// Need this PR to be merged to actually fix the issue: https://github.com/boostorg/ublas/pull/153 +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif #include @@ -309,6 +323,12 @@ public : } // numeric } // boost - +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif #endif // BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED diff --git a/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp b/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp index 02c37492b..4a77f65d7 100644 --- a/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp +++ b/include/boost/numeric/odeint/stepper/bulirsch_stoer.hpp @@ -88,6 +88,18 @@ class bulirsch_stoer { #endif //DOXYGEN_SKIP const static size_t m_k_max = 8; +// Claims m_error_checker will be init after m_max_dt +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreorder-ctor" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreorder" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5038) +#endif + bulirsch_stoer( value_type eps_abs = 1E-6 , value_type eps_rel = 1E-6 , value_type factor_x = 1.0 , value_type factor_dxdt = 1.0 , @@ -123,6 +135,13 @@ class bulirsch_stoer { reset(); } +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif /* * Version 1 : try_step( sys , x , t , dt ) diff --git a/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp b/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp index 22eb373bb..6589e980c 100644 --- a/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp +++ b/include/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp @@ -95,6 +95,17 @@ class bulirsch_stoer_dense_out { const static size_t m_k_max = 8; +// Claims m_error_checker will be init after m_max_dt +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreorder-ctor" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreorder" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5038) +#endif bulirsch_stoer_dense_out( value_type eps_abs = 1E-6 , value_type eps_rel = 1E-6 , @@ -838,4 +849,12 @@ class bulirsch_stoer_dense_out { } } +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + #endif // BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED diff --git a/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp b/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp index 3c59810b6..be4c1c257 100644 --- a/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp +++ b/include/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp @@ -164,8 +164,8 @@ class explicit_error_generic_rk : public explicit_error_stepper_base resizer_type m_resizer; - wrapped_state_type m_x_tmp; - wrapped_deriv_type m_F[StageCount-1]; + wrapped_state_type m_x_tmp {}; + wrapped_deriv_type m_F[StageCount-1] {}; }; diff --git a/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp b/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp index f8edc201a..497d0fbab 100644 --- a/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp +++ b/include/boost/numeric/odeint/stepper/explicit_generic_rk.hpp @@ -78,6 +78,10 @@ struct stage_wrapper }; #endif +#if defined(__GNUC__) && __GNUC__ >= 7 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wuninitialized" +#endif template< size_t StageCount, @@ -183,7 +187,9 @@ class explicit_generic_rk : public explicit_stepper_base }; - +#if defined(__GNUC__) && __GNUC__ >= 7 +# pragma GCC diagnostic pop +#endif /*********** DOXYGEN *************/ diff --git a/include/boost/numeric/odeint/stepper/generation/generation_controlled_adams_bashforth_moulton.hpp b/include/boost/numeric/odeint/stepper/generation/generation_controlled_adams_bashforth_moulton.hpp index ca95a1f55..e4eafc679 100644 --- a/include/boost/numeric/odeint/stepper/generation/generation_controlled_adams_bashforth_moulton.hpp +++ b/include/boost/numeric/odeint/stepper/generation/generation_controlled_adams_bashforth_moulton.hpp @@ -40,13 +40,13 @@ struct controller_factory< Stepper , controlled_adams_bashforth_moulton< Stepper typedef typename stepper_type::value_type value_type; typedef typename stepper_type::value_type time_type; - controller_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper ) + controller_type operator()( value_type abs_error , value_type rel_error , const stepper_type &/*stepper*/ ) { return controller_type(step_adjuster_type(abs_error, rel_error)); } controller_type operator()( value_type abs_error , value_type rel_error , - time_type max_dt, const stepper_type &stepper ) + time_type max_dt, const stepper_type &/*stepper*/ ) { return controller_type( step_adjuster_type(abs_error, rel_error, max_dt)); } diff --git a/include/boost/numeric/odeint/stepper/implicit_euler.hpp b/include/boost/numeric/odeint/stepper/implicit_euler.hpp index e1c64164b..efd84c9bf 100644 --- a/include/boost/numeric/odeint/stepper/implicit_euler.hpp +++ b/include/boost/numeric/odeint/stepper/implicit_euler.hpp @@ -19,6 +19,20 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif #include @@ -166,5 +180,12 @@ class implicit_euler } // numeric } // boost +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif #endif // BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED diff --git a/include/boost/numeric/odeint/stepper/rosenbrock4.hpp b/include/boost/numeric/odeint/stepper/rosenbrock4.hpp index 86136989d..b2071e804 100644 --- a/include/boost/numeric/odeint/stepper/rosenbrock4.hpp +++ b/include/boost/numeric/odeint/stepper/rosenbrock4.hpp @@ -20,6 +20,21 @@ #ifndef BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED +// Need this PR to be merged to actually fix the issue: https://github.com/boostorg/ublas/pull/153 +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif #include #include @@ -343,4 +358,13 @@ class rosenbrock4 } // namespace numeric } // namespace boost +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + + #endif // BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED diff --git a/include/boost/numeric/odeint/util/detail/less_with_sign.hpp b/include/boost/numeric/odeint/util/detail/less_with_sign.hpp index 3ffa7ca17..c03ee255a 100644 --- a/include/boost/numeric/odeint/util/detail/less_with_sign.hpp +++ b/include/boost/numeric/odeint/util/detail/less_with_sign.hpp @@ -26,6 +26,11 @@ namespace numeric { namespace odeint { namespace detail { +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + /** * return t1 < t2 if dt > 0 and t1 > t2 if dt < 0 with epsilon accuracy */ @@ -73,6 +78,11 @@ T max_abs( T t1 , T t2 ) else return min BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); } + +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif + } } } } #endif diff --git a/include/boost/numeric/odeint/util/ublas_wrapper.hpp b/include/boost/numeric/odeint/util/ublas_wrapper.hpp index c8facfc46..b422345da 100644 --- a/include/boost/numeric/odeint/util/ublas_wrapper.hpp +++ b/include/boost/numeric/odeint/util/ublas_wrapper.hpp @@ -18,6 +18,21 @@ #ifndef BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED +// Need this PR to be merged to actually fix the issue: https://github.com/boostorg/ublas/pull/153 +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif #include #include @@ -293,5 +308,12 @@ struct state_wrapper< boost::numeric::ublas::permutation_matrix< T , A > > // wi } } } +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif #endif // BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED diff --git a/include/boost/numeric/odeint/version.hpp b/include/boost/numeric/odeint/version.hpp index 379c90659..befc9b9c2 100644 --- a/include/boost/numeric/odeint/version.hpp +++ b/include/boost/numeric/odeint/version.hpp @@ -19,7 +19,7 @@ #include #include - +#include #define ODEINT_MAJOR_VERSION 2 #define ODEINT_MINOR_VERSION 2 @@ -39,14 +39,26 @@ const int patch_level = ODEINT_PATCH_LEVEL ; } +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4127) +#endif + inline std::string get_version_string( void ) { std::ostringstream str; str << "v" << version::major << "." << version::minor; - if( version::patch_level != 0 ) str << "_" << version::patch_level; + BOOST_IF_CONSTEXPR( version::patch_level != 0 ) + { + str << "_" << version::patch_level; + } + return str.str(); } +#ifdef _MSC_VER +# pragma warning(pop) +#endif } } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 33caa4c58..ddc960084 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -27,6 +27,11 @@ project static clang:-Wno-unused-variable # -D_SCL_SECURE_NO_WARNINGS + _CRT_SECURE_NO_WARNINGS + extra + # msvc:on + clang:on + gcc:on [ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ] ; @@ -43,11 +48,11 @@ test-suite "odeint" [ run implicit_euler.cpp ] # disable in clang [ run fusion_algebra.cpp : : : clang:no gcc-mingw:-Wa,-mbig-obj off msvc:/bigobj ] - [ run stepper_with_units.cpp : : : clang:no gcc-mingw:-Wa,-mbig-obj off msvc:/bigobj ] + [ run stepper_with_units.cpp : : : clang:no gcc-mingw:-Wa,-mbig-obj off msvc:/bigobj [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] [ run stepper_copying.cpp ] [ run stepper_with_ranges.cpp ] [ run rosenbrock4.cpp ] - [ run rosenbrock4_mp.cpp ] + [ run rosenbrock4_mp.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] [ run is_pair.cpp ] [ run adams_bashforth.cpp ] [ run adams_moulton.cpp ] @@ -56,11 +61,11 @@ test-suite "odeint" [ run adaptive_adams_coefficients.cpp ] [ run generic_stepper.cpp ] [ run generic_error_stepper.cpp ] - [ run bulirsch_stoer.cpp ] - [ run integrate_times.cpp ] - [ run integrate_times.cpp : : : ODEINT_INTEGRATE_ITERATOR : integrate_times_iterator ] - [ run integrate.cpp ] - [ run integrate.cpp : : : ODEINT_INTEGRATE_ITERATOR : integrate_iterator ] + [ run bulirsch_stoer.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] + [ run integrate_times.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] + [ run integrate_times.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ODEINT_INTEGRATE_ITERATOR : integrate_times_iterator ] + [ run integrate.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] + [ run integrate.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ODEINT_INTEGRATE_ITERATOR : integrate_iterator ] [ run integrate_implicit.cpp ] [ run integrate_implicit.cpp : : : ODEINT_INTEGRATE_ITERATOR : integrate_implicit_iterator ] [ run generation.cpp ] @@ -84,11 +89,11 @@ test-suite "odeint" [ run n_step_time_iterator.cpp ] [ run times_iterator.cpp ] [ run times_time_iterator.cpp ] - [ run step_size_limitation.cpp ] - [ run integrate_overflow.cpp ] + [ run step_size_limitation.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] + [ run integrate_overflow.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] [ compile unwrap_boost_reference.cpp ] [ compile unwrap_reference.cpp ] - [ compile std_array.cpp ] + [ compile std_array.cpp : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] : valgrind ; diff --git a/test/adams_bashforth.cpp b/test/adams_bashforth.cpp index 7574346c2..43a33dfaf 100644 --- a/test/adams_bashforth.cpp +++ b/test/adams_bashforth.cpp @@ -46,7 +46,7 @@ typedef double value_type; struct lorenz { template< class State , class Deriv , class Value > - void operator()( const State &_x , Deriv &_dxdt , const Value &dt ) const + void operator()( const State &_x , Deriv &_dxdt , const Value &/*dt*/ ) const { const value_type sigma = 10.0; const value_type R = 28.0; diff --git a/test/adams_bashforth_moulton.cpp b/test/adams_bashforth_moulton.cpp index 8e7688bb4..21f7acc5e 100644 --- a/test/adams_bashforth_moulton.cpp +++ b/test/adams_bashforth_moulton.cpp @@ -34,7 +34,7 @@ typedef double value_type; struct lorenz { template< class State , class Deriv , class Value > - void operator()( const State &_x , Deriv &_dxdt , const Value &dt ) const + void operator()( const State &_x , Deriv &_dxdt , const Value &/*dt*/ ) const { const value_type sigma = 10.0; const value_type R = 28.0; diff --git a/test/adams_moulton.cpp b/test/adams_moulton.cpp index faccdda5b..05e65fbf4 100644 --- a/test/adams_moulton.cpp +++ b/test/adams_moulton.cpp @@ -40,7 +40,7 @@ typedef double value_type; struct lorenz { template< class State , class Deriv , class Value > - void operator()( const State &_x , Deriv &_dxdt , const Value &dt ) const + void operator()( const State &_x , Deriv &_dxdt , const Value &/*dt*/ ) const { const value_type sigma = 10.0; const value_type R = 28.0; diff --git a/test/adaptive_iterator.cpp b/test/adaptive_iterator.cpp index 8f3cfa74a..572c86231 100644 --- a/test/adaptive_iterator.cpp +++ b/test/adaptive_iterator.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include "dummy_steppers.hpp" @@ -41,6 +41,11 @@ using namespace boost::numeric::odeint; typedef dummy_stepper::state_type state_type; typedef dummy_stepper::value_type value_type; +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + BOOST_AUTO_TEST_SUITE( adaptive_iterator_test ) typedef mpl::vector< @@ -48,7 +53,6 @@ typedef mpl::vector< , dummy_dense_output_stepper > dummy_steppers; - BOOST_AUTO_TEST_CASE( copy_controlled_stepper_iterator ) { typedef adaptive_iterator< dummy_controlled_stepper , empty_system , state_type > iterator_type; @@ -344,3 +348,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( copy_algorithm_with_range_factory , Stepper , dum BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif diff --git a/test/adaptive_time_iterator.cpp b/test/adaptive_time_iterator.cpp index 406a71c65..6a8247f87 100644 --- a/test/adaptive_time_iterator.cpp +++ b/test/adaptive_time_iterator.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include "dummy_steppers.hpp" diff --git a/test/bulirsch_stoer.cpp b/test/bulirsch_stoer.cpp index 2c6a0c95a..0fbd7ba4d 100644 --- a/test/bulirsch_stoer.cpp +++ b/test/bulirsch_stoer.cpp @@ -48,7 +48,7 @@ const double b = 8.0 / 3.0; struct lorenz { template< class State , class Deriv > - void operator()( const State &x , Deriv &dxdt , double t ) const + void operator()( const State &x , Deriv &dxdt , double /*t*/ ) const { dxdt[0] = sigma * ( x[1] - x[0] ); dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; @@ -59,7 +59,7 @@ struct lorenz struct const_system { template< class State , class Deriv > - void operator()( const State &x , Deriv &dxdt , double t ) const + void operator()( const State &/*x*/ , Deriv &dxdt , double /*t*/ ) const { dxdt[0] = 1.0; dxdt[1] = 1.0; @@ -70,7 +70,7 @@ struct const_system struct sin_system { template< class State , class Deriv > - void operator()( const State &x , Deriv &dxdt , double t ) const + void operator()( const State &x , Deriv &dxdt , double /*t*/ ) const { dxdt[0] = sin( x[0] ); dxdt[1] = cos( x[1] ); diff --git a/test/const_step_iterator.cpp b/test/const_step_iterator.cpp index 2d0ac9dbe..907127b3e 100644 --- a/test/const_step_iterator.cpp +++ b/test/const_step_iterator.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include "dummy_steppers.hpp" diff --git a/test/const_step_time_iterator.cpp b/test/const_step_time_iterator.cpp index 9227f5c04..5d210d4c6 100644 --- a/test/const_step_time_iterator.cpp +++ b/test/const_step_time_iterator.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include "dummy_steppers.hpp" @@ -78,6 +78,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( assignment_stepper_iterator , Stepper , dummy_ste BOOST_CHECK( iter1.same( iter2 ) ); } +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_iterator_factory , Stepper , dummy_steppers ) { Stepper stepper; @@ -92,6 +97,10 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_iterator_factory , Stepper , dummy_steppe BOOST_CHECK_CLOSE( x[0] , 3.5 , 1.0e-13 ); } +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif + BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_range , Stepper , dummy_steppers ) { Stepper stepper; diff --git a/test/controlled_adams_bashforth_moulton.cpp b/test/controlled_adams_bashforth_moulton.cpp index 40d657209..c2f58a9fb 100644 --- a/test/controlled_adams_bashforth_moulton.cpp +++ b/test/controlled_adams_bashforth_moulton.cpp @@ -2,6 +2,10 @@ #ifdef BOOST_MSVC #pragma warning(disable:4996) #endif +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif #define BOOST_TEST_MODULE odeint_controlled_adams_bashforth_moulton @@ -16,7 +20,7 @@ using namespace boost::numeric::odeint; struct const_sys { template< class State , class Deriv , class Value > - void operator()( const State &x , Deriv &dxdt , const Value &dt ) const + void operator()( const State &/*x*/ , Deriv &dxdt , const Value &/*dt*/ ) const { dxdt[0] = 1; } @@ -29,15 +33,15 @@ BOOST_AUTO_TEST_SUITE( controlled_adams_bashforth_moulton_test ) BOOST_AUTO_TEST_CASE( test_instantiation ) { - controlled_adams_bashforth_moulton > s1; - controlled_adams_bashforth_moulton > s2; - controlled_adams_bashforth_moulton > s3; - controlled_adams_bashforth_moulton > s4; - controlled_adams_bashforth_moulton > s5; - controlled_adams_bashforth_moulton > s6; - controlled_adams_bashforth_moulton > s7; - controlled_adams_bashforth_moulton > s8; - controlled_adams_bashforth_moulton > s9; + controlled_adams_bashforth_moulton > s1 {}; + controlled_adams_bashforth_moulton > s2 {}; + controlled_adams_bashforth_moulton > s3 {}; + controlled_adams_bashforth_moulton > s4 {}; + controlled_adams_bashforth_moulton > s5 {}; + controlled_adams_bashforth_moulton > s6 {}; + controlled_adams_bashforth_moulton > s7 {}; + controlled_adams_bashforth_moulton > s8 {}; + controlled_adams_bashforth_moulton > s9 {}; state_type x = {{ 10.0 }}; value_type t = 0.0 , dt = 0.01; @@ -53,4 +57,8 @@ BOOST_AUTO_TEST_CASE( test_instantiation ) s9.try_step(const_sys(), x, t, dt); } -BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file +BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif diff --git a/test/default_operations.cpp b/test/default_operations.cpp index a2634b7fe..6bf5b4eee 100644 --- a/test/default_operations.cpp +++ b/test/default_operations.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include diff --git a/test/diagnostic_state_type.hpp b/test/diagnostic_state_type.hpp index 0c21013ea..0ead8824f 100644 --- a/test/diagnostic_state_type.hpp +++ b/test/diagnostic_state_type.hpp @@ -91,7 +91,7 @@ namespace odeint { template< size_t N , size_t M > struct same_size_impl< diagnostic_type< N > , diagnostic_type< M > > { - static bool same_size( const diagnostic_type< N > &x1 , const diagnostic_type< M > &x2 ) + static bool same_size( const diagnostic_type< N > &/*x1*/ , const diagnostic_type< M > &/*x2*/ ) { return false; } @@ -100,7 +100,7 @@ namespace odeint { template< size_t N , class State1 > struct same_size_impl< diagnostic_type< N > , State1 > { - static bool same_size( const diagnostic_type< N > &x1 , const State1 &x2 ) + static bool same_size( const diagnostic_type< N > &/*x1*/ , const State1 &/*x2*/ ) { return false; } @@ -109,7 +109,7 @@ namespace odeint { template< class State1 , size_t N > struct same_size_impl< State1 , diagnostic_type< N > > { - static bool same_size( const State1 &x1 , const diagnostic_type< N > &x2 ) + static bool same_size( const State1 &/*x1*/ , const diagnostic_type< N > &/*x2*/ ) { return false; } @@ -120,7 +120,7 @@ namespace odeint { template< size_t N , class StateIn > struct resize_impl< diagnostic_type< N > , StateIn > { - static void resize( diagnostic_type< N > &x1 , const StateIn &x2 ) + static void resize( diagnostic_type< N > &/*x1*/ , const StateIn &/*x2*/ ) { counter< N >::adjust_size_count()++; } @@ -152,7 +152,7 @@ namespace odeint { counter< N >::copy_count()++; } - state_wrapper_type& operator=( const state_wrapper_type &x ) + state_wrapper_type& operator=( const state_wrapper_type &/*x*/ ) { counter< N >::copy_count()++; return *this; diff --git a/test/dummy_observers.hpp b/test/dummy_observers.hpp index 744c374f1..efef24013 100644 --- a/test/dummy_observers.hpp +++ b/test/dummy_observers.hpp @@ -27,7 +27,7 @@ namespace odeint { struct dummy_observer { template< class State > - void operator()( const State &s ) const + void operator()( const State &/*s*/ ) const { } }; diff --git a/test/dummy_odes.hpp b/test/dummy_odes.hpp index 7a92363f6..e19efe715 100644 --- a/test/dummy_odes.hpp +++ b/test/dummy_odes.hpp @@ -31,7 +31,7 @@ struct constant_system_functor_standard { template< class State , class Deriv , class Time > - void operator()( const State &x , Deriv &dxdt , const Time t ) const + void operator()( const State &/*x*/ , Deriv &dxdt , const Time /*t*/ ) const { dxdt[0] = 1.0; } @@ -40,7 +40,7 @@ struct constant_system_functor_standard struct constant_system_functor_vector_space { template< class State , class Deriv , class Time > - void operator()( const State &x , Deriv &dxdt , const Time t ) const + void operator()( const State &/*x*/ , Deriv &dxdt , const Time /*t*/ ) const { dxdt = 1.0; } @@ -49,7 +49,7 @@ struct constant_system_functor_vector_space struct constant_system_functor_fusion { template< class State , class Deriv , class Time > - void operator()( const State &x , Deriv &dxdt , const Time t ) const + void operator()( const State &x , Deriv &dxdt , const Time /*t*/ ) const { boost::fusion::at_c< 0 >( dxdt ) = boost::fusion::at_c< 0 >( x ) / Time( 1.0 ); } @@ -58,7 +58,7 @@ struct constant_system_functor_fusion struct lorenz { template< typename State , typename Deriv , typename Time > - void operator()( const State& x , Deriv& dxdt , const Time& t ) const + void operator()( const State& x , Deriv& dxdt , const Time& /*t*/ ) const { const Time sigma = 10.0; const Time R = 28.0; @@ -70,19 +70,19 @@ struct lorenz }; template< class State , class Deriv , class Time > -void constant_system_standard( const State &x , Deriv &dxdt , const Time t ) +void constant_system_standard( const State &/*x*/ , Deriv &dxdt , const Time /*t*/ ) { dxdt[0] = 1.0; } template< class State , class Deriv , class Time > -void constant_system_vector_space( const State &x , Deriv &dxdt , const Time t ) +void constant_system_vector_space( const State &/*x*/ , Deriv &dxdt , const Time /*t*/ ) { dxdt = 1.0; } template< class State , class Deriv , class Time > -void constant_system_fusion( const State &x , Deriv &dxdt , const Time t ) +void constant_system_fusion( const State &x , Deriv &dxdt , const Time /*t*/ ) { boost::fusion::at_c< 0 >( dxdt ) = boost::fusion::at_c< 0 >( x ) / Time( 1.0 ); } @@ -96,7 +96,7 @@ void constant_system_fusion( const State &x , Deriv &dxdt , const Time t ) struct constant_mom_func { template< class StateIn , class StateOut > - void operator()( const StateIn &q , StateOut &dp ) const + void operator()( const StateIn &/*q*/ , StateOut &dp ) const { dp[0] = 1.0; } @@ -116,7 +116,7 @@ struct default_coor_func struct constant_mom_func_vector_space_1d { template< class T > - void operator()( const T &q , T &dp ) const + void operator()( const T &/*q*/ , T &dp ) const { dp = 1.0; } @@ -140,7 +140,7 @@ struct default_coor_func_vector_space_1d struct empty_system { template - void operator()( const State &x , State &dxdt , double t ) const + void operator()( const State &/*x*/ , State &/*dxdt*/ , double /*t*/ ) const { } }; diff --git a/test/dummy_steppers.hpp b/test/dummy_steppers.hpp index 5f8d749fd..d4107d658 100644 --- a/test/dummy_steppers.hpp +++ b/test/dummy_steppers.hpp @@ -38,7 +38,7 @@ struct dummy_stepper order_type order( void ) const { return 1; } template< class System > - void do_step( System sys , state_type &x , time_type t , time_type dt ) const + void do_step( System /*sys*/ , state_type &x , time_type /*t*/ , time_type /*dt*/ ) const { x[0] += 0.25; } @@ -60,7 +60,7 @@ struct dummy_dense_output_stepper } template< class System > - std::pair< time_type , time_type > do_step( System sys ) + std::pair< time_type , time_type > do_step( System /*sys*/ ) { m_x[0] += 0.25; m_t += m_dt; @@ -105,7 +105,7 @@ struct dummy_controlled_stepper typedef controlled_stepper_tag stepper_category; template< class Sys > - controlled_step_result try_step( Sys sys , state_type &x , time_type &t , time_type &dt ) const + controlled_step_result try_step( Sys /*sys*/ , state_type &x , time_type &t , time_type &dt ) const { x[0] += 0.25; t += dt; diff --git a/test/euler_stepper.cpp b/test/euler_stepper.cpp index a274de4b2..8b9cad1f0 100644 --- a/test/euler_stepper.cpp +++ b/test/euler_stepper.cpp @@ -68,7 +68,7 @@ typedef my_vec state_type; /* use functors, because functions don't work with msvc 10, I guess this is a bug */ struct sys { - void operator()( const state_type &x , state_type &dxdt , const value_type t ) const + void operator()( const state_type &x , state_type &dxdt , const value_type ) const { std::cout << "sys start " << dxdt.size() << std::endl; dxdt[0] = x[0] + 2 * x[1]; diff --git a/test/fusion_algebra.cpp b/test/fusion_algebra.cpp index cc63fa921..9c640659a 100644 --- a/test/fusion_algebra.cpp +++ b/test/fusion_algebra.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/test/generation.cpp b/test/generation.cpp index 6432692d7..f39425306 100644 --- a/test/generation.cpp +++ b/test/generation.cpp @@ -29,7 +29,7 @@ using namespace boost::numeric::odeint; template< class Stepper1 , class Stepper2 > -void check_stepper_type( const Stepper1 &s1 , const Stepper2 &s2 ) +void check_stepper_type( const Stepper1 &/*s1*/ , const Stepper2 &/*s2*/ ) { BOOST_STATIC_ASSERT(( boost::is_same< Stepper1 , Stepper2 >::value )); } diff --git a/test/generic_error_stepper.cpp b/test/generic_error_stepper.cpp index 0b18da89b..eed507999 100644 --- a/test/generic_error_stepper.cpp +++ b/test/generic_error_stepper.cpp @@ -21,6 +21,11 @@ #pragma warning(disable:4996) #endif +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #define BOOST_TEST_MODULE odeint_generic_error_stepper #include @@ -42,7 +47,7 @@ namespace fusion = boost::fusion; typedef double value_type; typedef boost::array< value_type , 2 > state_type; -void sys( const state_type &x , state_type &dxdt , const value_type &t ) +void sys( const state_type &x , state_type &dxdt , const value_type &/*t*/ ) { dxdt[ 0 ] = x[ 0 ] + 2 * x[ 1 ]; dxdt[ 1 ] = x[ 1 ]; @@ -72,7 +77,7 @@ BOOST_AUTO_TEST_CASE( test_generic_error_stepper ) error_rk_generic_type rk_generic_( a , b , b2 , c ); error_rk_generic_type rk_generic = rk_generic_; - error_rk54_ck_generic_type rk54_ck_generic_; + error_rk54_ck_generic_type rk54_ck_generic_ {}; error_rk54_ck_generic_type rk54_ck_generic = rk54_ck_generic_; //std::cout << stepper; @@ -81,9 +86,6 @@ BOOST_AUTO_TEST_CASE( test_generic_error_stepper ) rk54_ck_type rk54_ck = rk54_ck_; typedef error_rk_generic_type::state_type state_type; - typedef error_rk_generic_type::value_type stepper_value_type; - typedef error_rk_generic_type::deriv_type deriv_type; - typedef error_rk_generic_type::time_type time_type; state_type x = {{ 0.0 , 1.0 }}; state_type y = x; @@ -109,3 +111,7 @@ BOOST_AUTO_TEST_CASE( test_generic_error_stepper ) } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif diff --git a/test/generic_stepper.cpp b/test/generic_stepper.cpp index e2c18272f..b2fd46c53 100644 --- a/test/generic_stepper.cpp +++ b/test/generic_stepper.cpp @@ -20,6 +20,11 @@ #pragma warning(disable:4996) #endif +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #define BOOST_TEST_MODULE odeint_generic_stepper #include @@ -41,7 +46,7 @@ namespace fusion = boost::fusion; typedef double value_type; typedef boost::array< value_type , 2 > state_type; -void sys( const state_type &x , state_type &dxdt , const value_type &t ) +void sys( const state_type &x , state_type &dxdt , const value_type &/*t*/ ) { dxdt[ 0 ] = x[ 0 ] + 2 * x[ 1 ]; dxdt[ 1 ] = x[ 1 ]; @@ -77,9 +82,6 @@ BOOST_AUTO_TEST_CASE( test_generic_stepper ) rk4_type rk4 = rk4_; typedef rk_generic_type::state_type state_type; - typedef rk_generic_type::value_type stepper_value_type; - typedef rk_generic_type::deriv_type deriv_type; - typedef rk_generic_type::time_type time_type; state_type x = {{ 0.0 , 1.0 }}; state_type y = x; @@ -102,3 +104,7 @@ BOOST_AUTO_TEST_CASE( test_generic_stepper ) } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif diff --git a/test/implicit_euler.cpp b/test/implicit_euler.cpp index 575c896a8..f088a958d 100644 --- a/test/implicit_euler.cpp +++ b/test/implicit_euler.cpp @@ -44,7 +44,7 @@ typedef boost::numeric::ublas::matrix< value_type > matrix_type; /* use functors, because functions don't work with msvc 10, I guess this is a bug */ struct sys { - void operator()( const state_type &x , state_type &dxdt , const value_type t ) const + void operator()( const state_type &x , state_type &dxdt , const value_type /*t*/ ) const { dxdt( 0 ) = x( 0 ) + 2 * x( 1 ); dxdt( 1 ) = x( 1 ); @@ -53,7 +53,7 @@ struct sys struct jacobi { - void operator()( const state_type &x , matrix_type &jacobi , const value_type t ) const + void operator()( const state_type &/*x*/ , matrix_type &jacobi , const value_type /*t*/ ) const { jacobi( 0 , 0 ) = 1; jacobi( 0 , 1 ) = 2; diff --git a/test/integrate.cpp b/test/integrate.cpp index 07d4617fa..de8024349 100644 --- a/test/integrate.cpp +++ b/test/integrate.cpp @@ -69,7 +69,7 @@ namespace mpl = boost::mpl; typedef double value_type; typedef std::vector< value_type > state_type; -void lorenz( const state_type &x , state_type &dxdt , const value_type t ) +void lorenz( const state_type &x , state_type &dxdt , const value_type /*t*/ ) { //const value_type sigma( 10.0 ); const value_type R( 28.0 ); diff --git a/test/integrate_implicit.cpp b/test/integrate_implicit.cpp index 4bff200ae..9893ce7e8 100644 --- a/test/integrate_implicit.cpp +++ b/test/integrate_implicit.cpp @@ -16,6 +16,23 @@ #define BOOST_TEST_MODULE odeint_integrate_functions_implicit +// Need this PR to be merged to actually fix the issue: https://github.com/boostorg/ublas/pull/153 +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif + #include #include #include @@ -59,7 +76,7 @@ typedef boost::numeric::ublas::matrix< value_type > matrix_type; struct sys { - void operator()( const state_type &x , state_type &dxdt , const value_type &t ) const + void operator()( const state_type &x , state_type &dxdt , const value_type &/*t*/ ) const { dxdt( 0 ) = x( 0 ) + 2 * x( 1 ); dxdt( 1 ) = x( 1 ); @@ -68,7 +85,7 @@ struct sys struct jacobi { - void operator()( const state_type &x , matrix_type &jacobi , const value_type &t , state_type &dfdt ) const + void operator()( const state_type &/*x*/ , matrix_type &jacobi , const value_type &/*t*/ , state_type &dfdt ) const { jacobi( 0 , 0 ) = 1; jacobi( 0 , 1 ) = 2; @@ -86,7 +103,7 @@ struct push_back_time push_back_time( std::vector< double > × ) : m_times( times ) { } - void operator()( const state_type &x , double t ) + void operator()( const state_type &/*x*/ , double t ) { m_times.push_back( t ); } @@ -231,3 +248,12 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( integrate_n_steps_test_case , Stepper, simple_ste } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + diff --git a/test/integrate_overflow.cpp b/test/integrate_overflow.cpp index 0dba4046a..332574250 100644 --- a/test/integrate_overflow.cpp +++ b/test/integrate_overflow.cpp @@ -39,7 +39,7 @@ typedef double value_type; typedef std::vector< value_type > state_type; // the famous lorenz system as usual -void lorenz( const state_type &x , state_type &dxdt , const value_type t ) +void lorenz( const state_type &x , state_type &dxdt , const value_type /*t*/ ) { //const value_type sigma( 10.0 ); const value_type R( 28.0 ); @@ -58,7 +58,7 @@ struct push_back_time push_back_time( std::vector< double > × ) : m_times( times ) { } - void operator()( const state_type &x , double t ) + void operator()( const state_type &/*x*/ , double t ) { m_times.push_back( t ); } diff --git a/test/integrate_stepper_refs.cpp b/test/integrate_stepper_refs.cpp index 5d6d34c94..96dc98617 100644 --- a/test/integrate_stepper_refs.cpp +++ b/test/integrate_stepper_refs.cpp @@ -58,7 +58,7 @@ public : typedef stepper_tag stepper_category; template< class System > - void do_step( System system , state_type &in , time_type t , time_type dt ) + void do_step( System /*system*/ , state_type &/*in*/ , time_type /*t*/ , time_type /*dt*/ ) { // empty @@ -80,7 +80,7 @@ public : typedef controlled_stepper_tag stepper_category; template< class System > - controlled_step_result try_step( System system , state_type &in , time_type &t , time_type &dt ) + controlled_step_result try_step( System /*system*/ , state_type &/*in*/ , time_type &t , time_type &dt ) { std::cout << "dense out stepper: " << t << " , " << dt << std::endl; t += dt; @@ -111,13 +111,13 @@ public : } template< class System > - void do_step( System system ) + void do_step( System /*system*/ ) { std::cout << "dense out stepper: " << m_t << " , " << m_dt << std::endl; m_t += m_dt; } - void calc_state( const time_type t_inter , state_type &x ) + void calc_state( const time_type /*t_inter*/ , state_type &x ) { x = m_x; } @@ -139,7 +139,7 @@ private : }; -void lorenz( const state_type &x , state_type &dxdt , const value_type t ) +void lorenz( const state_type &x , state_type &dxdt , const value_type /*t*/ ) { //const value_type sigma( 10.0 ); const value_type R( 28.0 ); diff --git a/test/integrate_times.cpp b/test/integrate_times.cpp index 2837f09e3..c16213e57 100644 --- a/test/integrate_times.cpp +++ b/test/integrate_times.cpp @@ -14,6 +14,11 @@ copy at http://www.boost.org/LICENSE_1_0.txt) */ +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #define BOOST_TEST_MODULE odeint_integrate_times #include @@ -67,7 +72,7 @@ struct push_back_time push_back_time( std::vector< double > × ) : m_times( times ) { } - void operator()( const state_type &x , double t ) + void operator()( const state_type &/*x*/ , double t ) { m_times.push_back( t ); } @@ -75,6 +80,11 @@ struct push_back_time BOOST_AUTO_TEST_SUITE( integrate_times_test ) +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + BOOST_AUTO_TEST_CASE( test_integrate_times ) { @@ -144,6 +154,9 @@ BOOST_AUTO_TEST_CASE( test_integrate_times ) } +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif BOOST_AUTO_TEST_CASE( test_integrate_times_ranges ) { @@ -245,3 +258,7 @@ BOOST_AUTO_TEST_CASE( test_integrate_times_overshoot ) } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif diff --git a/test/integrators_symplectic.cpp b/test/integrators_symplectic.cpp index 2c2861950..8fb42721f 100644 --- a/test/integrators_symplectic.cpp +++ b/test/integrators_symplectic.cpp @@ -19,6 +19,11 @@ #pragma warning(disable:4996) #endif +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #define BOOST_TEST_MODULE odeint_iterators_symplectic #define BOOST_FUSION_INVOKE_MAX_ARITY 15 @@ -72,3 +77,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_integrate_const , Stepper , complete_stepper } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif diff --git a/test/is_resizeable.cpp b/test/is_resizeable.cpp index cb8e9c1c7..bd34101f6 100644 --- a/test/is_resizeable.cpp +++ b/test/is_resizeable.cpp @@ -20,6 +20,21 @@ #pragma warning(disable:4996) #endif +// Need this PR to be merged to actually fix the issue: https://github.com/boostorg/ublas/pull/153 +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif + #define BOOST_TEST_MODULE odeint_is_resizeable #include @@ -97,7 +112,6 @@ BOOST_AUTO_TEST_CASE( test_fusion_quantity_sequence ) namespace si = boost::units::si; typedef double value_type; - typedef units::quantity< si::time , value_type > time_type; typedef units::quantity< si::length , value_type > length_type; typedef units::quantity< si::velocity , value_type > velocity_type; typedef boost::fusion::vector< length_type , velocity_type > state_type; @@ -113,4 +127,12 @@ BOOST_AUTO_TEST_CASE( test_my_seq1 ) BOOST_AUTO_TEST_CASE( test_my_seq2 ) { BOOST_CHECK( is_resizeable< my_seq2< double > >::value ); -} \ No newline at end of file +} + +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif diff --git a/test/multi_array.cpp b/test/multi_array.cpp index 67b7f964d..c2003094c 100644 --- a/test/multi_array.cpp +++ b/test/multi_array.cpp @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE( test_for_each2_vector ) struct vector_ode { const static size_t n = 128; - void operator()( const vector_type &x , vector_type &dxdt , double t ) const + void operator()( const vector_type &x , vector_type &dxdt , double /*t*/ ) const { dxdt[-1] = x[n] - 2.0 * x[-1] + x[0]; for( size_t i=0 ; i #include -#include +#include #include #include "dummy_steppers.hpp" diff --git a/test/numeric/Jamfile.v2 b/test/numeric/Jamfile.v2 index a4643f6a5..0b1618b2a 100644 --- a/test/numeric/Jamfile.v2 +++ b/test/numeric/Jamfile.v2 @@ -7,18 +7,23 @@ import testing ; +import ../../config/checks/config : requires ; use-project boost : $(BOOST_ROOT) ; project : requirements - /boost/test//boost_unit_test_framework BOOST_ALL_NO_LIB=1 - ../../include + # use test library + /boost//unit_test_framework static clang:-Wno-unused-variable - -# -D_SCL_SECURE_NO_WARNINGS + # -D_SCL_SECURE_NO_WARNINGS + extra + msvc:on + clang:on + gcc:on + [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ; test-suite "odeint" diff --git a/test/numeric/abm_time_dependent.cpp b/test/numeric/abm_time_dependent.cpp index 019a17d6c..ee746db6f 100644 --- a/test/numeric/abm_time_dependent.cpp +++ b/test/numeric/abm_time_dependent.cpp @@ -37,7 +37,7 @@ typedef value_type state_type; // simple time-dependent rhs, analytic solution x = 0.5*t^2 struct simple_rhs { - void operator()( const state_type& x , state_type &dxdt , const double t ) const + void operator()( const state_type& /*x*/ , state_type &dxdt , const double t ) const { dxdt = t; } diff --git a/test/numeric/adams_bashforth.cpp b/test/numeric/adams_bashforth.cpp index ca8a6cee9..6e3040648 100644 --- a/test/numeric/adams_bashforth.cpp +++ b/test/numeric/adams_bashforth.cpp @@ -38,7 +38,7 @@ typedef boost::array< double , 2 > state_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc { - void operator()( const state_type &x , state_type &dxdt , const double t ) const + void operator()( const state_type &x , state_type &dxdt , const double /*t*/ ) const { dxdt[0] = x[1]; dxdt[1] = -x[0]; diff --git a/test/numeric/adams_bashforth_moulton.cpp b/test/numeric/adams_bashforth_moulton.cpp index dea57182a..eedb0e9d8 100644 --- a/test/numeric/adams_bashforth_moulton.cpp +++ b/test/numeric/adams_bashforth_moulton.cpp @@ -39,7 +39,7 @@ typedef runge_kutta_fehlberg78 initializing_stepper; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc { - void operator()( const state_type &x , state_type &dxdt , const double t ) const + void operator()( const state_type &x , state_type &dxdt , const double /*t*/ ) const { dxdt[0] = x[1]; dxdt[1] = -x[0]; diff --git a/test/numeric/adaptive_adams_bashforth_moulton.cpp b/test/numeric/adaptive_adams_bashforth_moulton.cpp index 0932dd1dd..464ad0474 100644 --- a/test/numeric/adaptive_adams_bashforth_moulton.cpp +++ b/test/numeric/adaptive_adams_bashforth_moulton.cpp @@ -39,7 +39,7 @@ typedef runge_kutta_fehlberg78 initializing_stepper; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc { - void operator()( const state_type &x , state_type &dxdt , const double t ) const + void operator()( const state_type &x , state_type &dxdt , const double /*t*/ ) const { dxdt[0] = x[1]; dxdt[1] = -x[0]; diff --git a/test/numeric/order_quadrature_formula.cpp b/test/numeric/order_quadrature_formula.cpp index cefab4dae..7eb9703fe 100644 --- a/test/numeric/order_quadrature_formula.cpp +++ b/test/numeric/order_quadrature_formula.cpp @@ -15,13 +15,29 @@ #pragma warning(disable:4996) #endif +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#elif defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif + #define BOOST_TEST_MODULE order_quadrature_formula #include #include -#include "boost/format.hpp" - #include #include @@ -49,12 +65,16 @@ struct monomial monomial(int p = 0) : power( p ){}; - void operator()( const state_type &x , state_type &dxdt , const time_type t ) + void operator()( const state_type &/*x*/ , state_type & dxdt , const time_type t ) { dxdt = ( 1.0 + power ) * pow( t, power ); } }; +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif /* generic test for all steppers that support integrate_const */ template< class Stepper > @@ -193,3 +213,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( adams_bashforth_moultion_test , Stepper, abm_step } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif diff --git a/test/numeric/rosenbrock.cpp b/test/numeric/rosenbrock.cpp index 2b6a26788..a3c7825c4 100644 --- a/test/numeric/rosenbrock.cpp +++ b/test/numeric/rosenbrock.cpp @@ -37,7 +37,7 @@ typedef boost::numeric::ublas::matrix< value_type > matrix_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct sys { - void operator()( const state_type &x , state_type &dxdt , const value_type &t ) const + void operator()( const state_type &x , state_type &dxdt , const value_type &/*t*/ ) const { dxdt( 0 ) = x( 1 ); dxdt( 1 ) = -x( 0 ); @@ -46,7 +46,7 @@ struct sys struct jacobi { - void operator()( const state_type &x , matrix_type &jacobi , const value_type &t , state_type &dfdt ) const + void operator()( const state_type &/*x*/ , matrix_type &jacobi , const value_type &/*t*/ , state_type &dfdt ) const { jacobi( 0 , 0 ) = 0; jacobi( 0 , 1 ) = 1; diff --git a/test/numeric/runge_kutta.cpp b/test/numeric/runge_kutta.cpp index a71701bde..4ae7c178e 100644 --- a/test/numeric/runge_kutta.cpp +++ b/test/numeric/runge_kutta.cpp @@ -39,7 +39,7 @@ typedef boost::array< double , 2 > state_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc { - void operator()( const state_type &x , state_type &dxdt , const double t ) const + void operator()( const state_type &x , state_type &dxdt , const double /*t*/ ) const { dxdt[0] = x[1]; dxdt[1] = -x[0]; @@ -51,7 +51,7 @@ template< class StepperCategory > struct resetter { template< class Stepper > - static void reset( Stepper &stepper ) { } + static void reset( Stepper &/*stepper*/ ) { } }; template< > diff --git a/test/numeric/velocity_verlet.cpp b/test/numeric/velocity_verlet.cpp index 5ac77807b..6423f5158 100644 --- a/test/numeric/velocity_verlet.cpp +++ b/test/numeric/velocity_verlet.cpp @@ -38,8 +38,8 @@ typedef boost::array< double , 1 > state_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc { - void operator()( const state_type &x, const state_type &v, state_type &a, - const double t ) const + void operator()( const state_type &x, const state_type &/*v*/, state_type &a, + const double /*t*/ ) const { a[0] = -x[0]; } diff --git a/test/range_algebra.cpp b/test/range_algebra.cpp index d80e9519d..4d66cc933 100644 --- a/test/range_algebra.cpp +++ b/test/range_algebra.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/test/regression/Jamfile.v2 b/test/regression/Jamfile.v2 index c476822f3..4fb30ec2c 100644 --- a/test/regression/Jamfile.v2 +++ b/test/regression/Jamfile.v2 @@ -13,20 +13,24 @@ use-project boost : $(BOOST_ROOT) ; project : requirements - /boost/test//boost_unit_test_framework BOOST_ALL_NO_LIB=1 - ../../include + # use test library + /boost//unit_test_framework static clang:-Wno-unused-variable - -# -D_SCL_SECURE_NO_WARNINGS + # -D_SCL_SECURE_NO_WARNINGS + extra + msvc:on + clang:on + gcc:on + [ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ] ; test-suite "odeint" : - [ run regression_147.cpp ] - [ compile regression_149.cpp ] + [ run regression_147.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] + [ compile regression_149.cpp : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] [ run regression_168.cpp : : : gcc-mingw:-Wa,-mbig-obj off msvc:/bigobj [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] - [ run regression_189.cpp ] + [ run regression_189.cpp : : : [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] ] : valgrind ; diff --git a/test/regression/regression_147.cpp b/test/regression/regression_147.cpp index 7373782df..9fb547a54 100644 --- a/test/regression/regression_147.cpp +++ b/test/regression/regression_147.cpp @@ -20,6 +20,11 @@ #pragma warning(disable:4996) #endif +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #define BOOST_TEST_MODULE odeint_regression_147 #include @@ -38,7 +43,7 @@ namespace mpl = boost::mpl; typedef double state_type; -void rhs( const state_type &x , state_type &dxdt , const double t ) +void rhs( const state_type &/*x*/ , state_type &dxdt , const double /*t*/ ) { dxdt = 1; } @@ -55,7 +60,7 @@ struct perform_init_test state_type x = 0; Stepper stepper; - InitStepper init_stepper; + InitStepper init_stepper {}; stepper.initialize( init_stepper, rhs, x, t, dt ); // ab-stepper needs order-1 init steps: t and x should be (order-1)*dt @@ -86,3 +91,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( init_test , InitStepper, } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif diff --git a/test/regression/regression_149.cpp b/test/regression/regression_149.cpp index 2790d683f..aa2567c7d 100644 --- a/test/regression/regression_149.cpp +++ b/test/regression/regression_149.cpp @@ -39,7 +39,7 @@ namespace mpl = boost::mpl; typedef std::vector state_type; -void rhs( const state_type &x , state_type &dxdt , const double t ) +void rhs( const state_type &/*x*/ , state_type &/*dxdt*/ , const double /*t*/ ) { } diff --git a/test/regression/regression_168.cpp b/test/regression/regression_168.cpp index 8349261a6..3b4698e54 100644 --- a/test/regression/regression_168.cpp +++ b/test/regression/regression_168.cpp @@ -71,7 +71,7 @@ struct oscillator oscillator( const frequency_type &omega = 1.0 * si::hertz ) : m_omega( omega ) { } - void operator()( const state_type &x , deriv_type &dxdt , time_type t ) const + void operator()( const state_type &x , deriv_type &dxdt , time_type /*t*/ ) const { fusion::at_c< 0 >( dxdt ) = fusion::at_c< 1 >( x ); fusion::at_c< 1 >( dxdt ) = - m_omega * m_omega * fusion::at_c< 0 >( x ); diff --git a/test/regression/regression_189.cpp b/test/regression/regression_189.cpp index f2627553d..ef7ad4820 100644 --- a/test/regression/regression_189.cpp +++ b/test/regression/regression_189.cpp @@ -15,6 +15,11 @@ #define BOOST_TEST_MODULE odeint_regression_189 +#if defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#endif + #include #include @@ -69,10 +74,14 @@ BOOST_AUTO_TEST_CASE( regression_189 ) std::cout << phoenix::arg_names::arg2 << " " << phoenix::arg_names::arg1[0] << "\n" ); num_of_steps_expected = 1531; - // Apple ARM arch takes one additional step - #if defined(__aarch64__) && defined(__APPLE__) + // Apple ARM arch takes one additional step, but only with clang + #if defined(__aarch64__) && defined(__APPLE__) && defined(__clang__) ++num_of_steps_expected; #endif BOOST_CHECK_EQUAL( num_of_steps2 , num_of_steps_expected ); } + +#if defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#endif diff --git a/test/resize.cpp b/test/resize.cpp index db40f4bfe..96d8ba88d 100644 --- a/test/resize.cpp +++ b/test/resize.cpp @@ -88,7 +88,6 @@ BOOST_AUTO_TEST_CASE( test_fusion_quantity_sequence ) namespace si = boost::units::si; typedef double value_type; - typedef units::quantity< si::time , value_type > time_type; typedef units::quantity< si::length , value_type > length_type; typedef units::quantity< si::velocity , value_type > velocity_type; typedef boost::fusion::vector< length_type , velocity_type > state_type; diff --git a/test/resizing.cpp b/test/resizing.cpp index 751795195..45fad04d4 100644 --- a/test/resizing.cpp +++ b/test/resizing.cpp @@ -20,13 +20,18 @@ #pragma warning(disable:4996) #endif +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #define BOOST_TEST_MODULE odeint_resize #include #include #include -#include +#include #include #include @@ -48,6 +53,7 @@ using namespace boost::unit_test; using namespace boost::numeric::odeint; +using namespace boost::placeholders; namespace mpl = boost::mpl; @@ -56,7 +62,7 @@ namespace mpl = boost::mpl; -void constant_system( const test_array_type &x , test_array_type &dxdt , double t ) { dxdt[0] = 1.0; } +void constant_system( const test_array_type & , test_array_type &dxdt , double ) { dxdt[0] = 1.0; } BOOST_AUTO_TEST_SUITE( check_resize_test ) @@ -96,8 +102,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_resize , T, resize_check_types ) const size_t multiplicity = mpl::at< T , mpl::int_< 2 > >::type::value; adjust_size_count = 0; - stepper_type stepper; - test_array_type x; + stepper_type stepper {}; + test_array_type x {}; stepper.do_step( constant_system , x , 0.0 , 0.1 ); stepper.do_step( constant_system , x , 0.0 , 0.1 ); stepper.do_step( constant_system , x , 0.0 , 0.1 ); @@ -108,3 +114,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_resize , T, resize_check_types ) BOOST_AUTO_TEST_SUITE_END() + + +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif diff --git a/test/resizing_test_state_type.hpp b/test/resizing_test_state_type.hpp index af55937ad..749145b77 100644 --- a/test/resizing_test_state_type.hpp +++ b/test/resizing_test_state_type.hpp @@ -46,7 +46,7 @@ namespace odeint { template<> struct same_size_impl< test_array_type , test_array_type > { - static bool same_size( const test_array_type &x1 , const test_array_type &x2 ) + static bool same_size( const test_array_type &/*x1*/ , const test_array_type & /*x2*/ ) { return false; } @@ -55,7 +55,7 @@ namespace odeint { template<> struct resize_impl< test_array_type , test_array_type > { - static void resize( test_array_type &x1 , const test_array_type &x2 ) + static void resize( test_array_type & /*x1*/, const test_array_type & /*x2*/) { adjust_size_count++; } diff --git a/test/rosenbrock4.cpp b/test/rosenbrock4.cpp index 0b7bea4ba..39611f5b5 100644 --- a/test/rosenbrock4.cpp +++ b/test/rosenbrock4.cpp @@ -44,7 +44,7 @@ typedef boost::numeric::ublas::matrix< value_type > matrix_type; struct sys { - void operator()( const state_type &x , state_type &dxdt , const value_type &t ) const + void operator()( const state_type &x , state_type &dxdt , const value_type &/*t*/ ) const { dxdt( 0 ) = x( 0 ) + 2 * x( 1 ); dxdt( 1 ) = x( 1 ); @@ -53,7 +53,7 @@ struct sys struct jacobi { - void operator()( const state_type &x , matrix_type &jacobi , const value_type &t , state_type &dfdt ) const + void operator()( const state_type &/*x*/ , matrix_type &jacobi , const value_type &/*t*/ , state_type &dfdt ) const { jacobi( 0 , 0 ) = 1; jacobi( 0 , 1 ) = 2; @@ -72,9 +72,6 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_stepper ) stepper_type stepper; typedef stepper_type::state_type state_type; - typedef stepper_type::value_type stepper_value_type; - typedef stepper_type::deriv_type deriv_type; - typedef stepper_type::time_type time_type; state_type x( 2 ) , xerr( 2 ); x(0) = 0.0; x(1) = 1.0; @@ -98,9 +95,6 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_controller ) stepper_type stepper; typedef stepper_type::state_type state_type; - typedef stepper_type::value_type stepper_value_type; - typedef stepper_type::deriv_type deriv_type; - typedef stepper_type::time_type time_type; state_type x( 2 ); x( 0 ) = 0.0 ; x(1) = 1.0; @@ -117,9 +111,7 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_dense_output ) stepper_type stepper( c_stepper ); typedef stepper_type::state_type state_type; - typedef stepper_type::value_type stepper_value_type; - typedef stepper_type::deriv_type deriv_type; - typedef stepper_type::time_type time_type; + state_type x( 2 ); x( 0 ) = 0.0 ; x(1) = 1.0; stepper.initialize( x , 0.0 , 0.1 ); @@ -143,9 +135,7 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_dense_output_ref ) stepper_type stepper( boost::ref( c_stepper ) ); typedef stepper_type::state_type state_type; - typedef stepper_type::value_type stepper_value_type; - typedef stepper_type::deriv_type deriv_type; - typedef stepper_type::time_type time_type; + state_type x( 2 ); x( 0 ) = 0.0 ; x(1) = 1.0; stepper.initialize( x , 0.0 , 0.1 ); diff --git a/test/rosenbrock4_mp.cpp b/test/rosenbrock4_mp.cpp index dc295c473..5d3bcb83c 100644 --- a/test/rosenbrock4_mp.cpp +++ b/test/rosenbrock4_mp.cpp @@ -20,6 +20,12 @@ #pragma warning(disable:4996) #endif +// Stems from Boost.Multiprecision +#if defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpessimizing-move" +#endif + #define BOOST_TEST_MODULE odeint_rosenbrock4 #include @@ -45,7 +51,7 @@ typedef boost::numeric::ublas::matrix< value_type > matrix_type; struct sys { - void operator()( const state_type &x , state_type &dxdt , const value_type &t ) const + void operator()( const state_type &x , state_type &dxdt , const value_type &/*t*/ ) const { dxdt( 0 ) = x( 0 ) + 2 * x( 1 ); dxdt( 1 ) = x( 1 ); @@ -54,7 +60,7 @@ struct sys struct jacobi { - void operator()( const state_type &x , matrix_type &jacobi , const value_type &t , state_type &dfdt ) const + void operator()( const state_type &/*x*/ , matrix_type &jacobi , const value_type &/*t*/ , state_type &dfdt ) const { jacobi( 0 , 0 ) = 1; jacobi( 0 , 1 ) = 2; @@ -73,9 +79,6 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_stepper ) stepper_type stepper; typedef stepper_type::state_type state_type; - typedef stepper_type::value_type stepper_value_type; - typedef stepper_type::deriv_type deriv_type; - typedef stepper_type::time_type time_type; state_type x( 2 ) , xerr( 2 ); x(0) = 0.0; x(1) = 1.0; @@ -101,9 +104,6 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_controller ) stepper_type stepper; typedef stepper_type::state_type state_type; - typedef stepper_type::value_type stepper_value_type; - typedef stepper_type::deriv_type deriv_type; - typedef stepper_type::time_type time_type; state_type x( 2 ); x( 0 ) = 0.0 ; x(1) = 1.0; @@ -120,9 +120,7 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_dense_output ) stepper_type stepper( c_stepper ); typedef stepper_type::state_type state_type; - typedef stepper_type::value_type stepper_value_type; - typedef stepper_type::deriv_type deriv_type; - typedef stepper_type::time_type time_type; + state_type x( 2 ); x( 0 ) = 0.0 ; x(1) = 1.0; stepper.initialize( x , 0.0 , 0.1 ); @@ -141,3 +139,7 @@ BOOST_AUTO_TEST_CASE( test_rosenbrock4_copy_dense_output ) } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#endif diff --git a/test/runge_kutta_concepts.cpp b/test/runge_kutta_concepts.cpp index 42235dea4..0e9c66433 100644 --- a/test/runge_kutta_concepts.cpp +++ b/test/runge_kutta_concepts.cpp @@ -21,6 +21,21 @@ #pragma warning(disable:4996) #endif +// Need this PR to be merged to actually fix the issue: https://github.com/boostorg/ublas/pull/153 +#if defined(__clang__) && __clang_major__ >= 13 && !defined(__APPLE__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy" +#elif defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 5267) +#endif + #define BOOST_TEST_MODULE odeint_runge_kutta_concepts #include @@ -34,7 +49,7 @@ #include #include -#include +#include #include #include @@ -64,6 +79,7 @@ using std::vector; using namespace boost::unit_test; using namespace boost::numeric::odeint; +using namespace boost::placeholders; namespace mpl = boost::mpl; const double result = 2.2; @@ -74,8 +90,6 @@ template< class Stepper , class System > void check_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x ) { typedef Stepper stepper_type; - typedef typename stepper_type::deriv_type container_type; - typedef typename stepper_type::order_type order_type; typedef typename stepper_type::time_type time_type; stepper.do_step( system , x , static_cast(0.0) , static_cast(0.1) ); @@ -215,3 +229,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_test2 , Stepper, stepper_combinations2 ) BOOST_AUTO_TEST_SUITE_END() + +#if defined(__clang__) && __clang_major__ >= 10 +#pragma clang diagnostic pop +#elif defined(__GNUC__) && __GNUC__ >= 9 +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif diff --git a/test/runge_kutta_controlled_concepts.cpp b/test/runge_kutta_controlled_concepts.cpp index 7f70cc533..c00c893a2 100644 --- a/test/runge_kutta_controlled_concepts.cpp +++ b/test/runge_kutta_controlled_concepts.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include @@ -60,6 +60,7 @@ using std::vector; using namespace boost::unit_test; using namespace boost::numeric::odeint; +using namespace boost::placeholders; namespace mpl = boost::mpl; const double result = 2.2; // two steps @@ -70,7 +71,7 @@ template< class Stepper , class System > void check_controlled_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x ) { typedef Stepper stepper_type; - typedef typename stepper_type::deriv_type container_type; + //typedef typename stepper_type::deriv_type container_type; //typedef typename stepper_type::order_type order_type; controlled_error_stepper don't necessarily have a order (burlish-stoer) typedef typename stepper_type::time_type time_type; @@ -162,7 +163,7 @@ struct perform_controlled_stepper_test< ControlledStepper , boost::array > using std::abs; array_type x; x[0] = 2.0; - ControlledStepper controlled_stepper; + ControlledStepper controlled_stepper {}; constant_system_functor_standard sys; #ifndef _MSC_VER // dont run this for MSVC due to compiler bug 697006 diff --git a/test/runge_kutta_error_concepts.cpp b/test/runge_kutta_error_concepts.cpp index 06980772a..6babc99f4 100644 --- a/test/runge_kutta_error_concepts.cpp +++ b/test/runge_kutta_error_concepts.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include @@ -58,6 +58,7 @@ using std::vector; using namespace boost::unit_test; using namespace boost::numeric::odeint; +using namespace boost::placeholders; namespace mpl = boost::mpl; const double result = 2.4; // four steps total... @@ -68,8 +69,6 @@ template< class Stepper , class System > void check_error_stepper_concept( Stepper &stepper , System system , typename Stepper::state_type &x , typename Stepper::state_type &xerr ) { typedef Stepper stepper_type; - typedef typename stepper_type::deriv_type container_type; - typedef typename stepper_type::order_type order_type; typedef typename stepper_type::time_type time_type; stepper.do_step( system , x , static_cast(0.0) , static_cast(0.1) ); diff --git a/test/std_array.cpp b/test/std_array.cpp index 350a387a8..f8cbe40f2 100644 --- a/test/std_array.cpp +++ b/test/std_array.cpp @@ -27,7 +27,7 @@ using namespace boost::unit_test; typedef std::array state_type; -void rhs(const state_type &x, state_type &dxdt, const double t) +void rhs(const state_type &/*x*/, state_type &/*dxdt*/, const double /*t*/) { } @@ -35,7 +35,7 @@ BOOST_AUTO_TEST_SUITE( unwrap_reference_test ) BOOST_AUTO_TEST_CASE( test_case ) { - state_type x = {0.0, 0.0, 0.0}; + state_type x = {{0.0, 0.0, 0.0}}; typedef boost::numeric::odeint::runge_kutta4 stepper_type; // check if array algebra is selected, but only if odeint detects c++11 diff --git a/test/step_size_limitation.cpp b/test/step_size_limitation.cpp index 2d8e4725d..8b83e4028 100644 --- a/test/step_size_limitation.cpp +++ b/test/step_size_limitation.cpp @@ -34,7 +34,7 @@ typedef std::vector< value_type > state_type; *********************************************** */ -void damped_osc( const state_type &x , state_type &dxdt , const value_type t ) +void damped_osc( const state_type &x , state_type &dxdt , const value_type /*t*/ ) { const value_type gam( 0.1); @@ -51,7 +51,7 @@ struct push_back_time : m_times( times ) { } template - void operator()( const State &x , double t ) + void operator()( const State &/*x*/ , double t ) { m_times.push_back( t ); } @@ -189,7 +189,7 @@ typedef boost::numeric::ublas::matrix< value_type > matrix_type; // harmonic oscillator, analytic solution x[0] = sin( t ) struct osc_rhs { - void operator()( const vector_type &x , vector_type &dxdt , const value_type &t ) const + void operator()( const vector_type &x , vector_type &dxdt , const value_type &/*t*/ ) const { dxdt( 0 ) = x( 1 ); dxdt( 1 ) = -x( 0 ); @@ -198,7 +198,7 @@ struct osc_rhs struct osc_jacobi { - void operator()( const vector_type &x , matrix_type &jacobi , const value_type &t , vector_type &dfdt ) const + void operator()( const vector_type &/*x*/ , matrix_type &jacobi , const value_type &/*t*/ , vector_type &dfdt ) const { jacobi( 0 , 0 ) = 0; jacobi( 0 , 1 ) = 1; diff --git a/test/stepper_copying.cpp b/test/stepper_copying.cpp index c29e4de19..25752d921 100644 --- a/test/stepper_copying.cpp +++ b/test/stepper_copying.cpp @@ -148,7 +148,7 @@ namespace boost { namespace numeric { namespace odeint { copy_count++; } - state_wrapper_type& operator=( const state_wrapper_type &x ) + state_wrapper_type& operator=( const state_wrapper_type & /*x*/ ) { copy_count++; return *this; @@ -187,7 +187,7 @@ namespace boost { namespace numeric { namespace odeint { copy2_count++; } - state_wrapper_type& operator=( const state_wrapper_type &x ) + state_wrapper_type& operator=( const state_wrapper_type & /*x*/ ) { copy2_count++; return *this; diff --git a/test/stepper_with_ranges.cpp b/test/stepper_with_ranges.cpp index 59f007f2d..3a5a330b9 100644 --- a/test/stepper_with_ranges.cpp +++ b/test/stepper_with_ranges.cpp @@ -61,7 +61,7 @@ struct algebra_dispatcher< state_type2 > struct system1 { template< class State , class Deriv > - void operator()( const State &x_ , Deriv &dxdt_ , double t ) + void operator()( const State &x_ , Deriv &dxdt_ , double /*t*/ ) { typename boost::range_iterator< const State >::type x = boost::begin( x_ ); typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ ); @@ -72,7 +72,7 @@ struct system1 } template< class State , class Deriv > - void operator()( const State &x_ , const Deriv &dxdt_ , double t ) + void operator()( const State &x_ , const Deriv &dxdt_ , double /*t*/ ) { typename boost::range_iterator< const State >::type x = boost::begin( x_ ); typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ ); @@ -89,7 +89,7 @@ struct system1 struct system2 { template< class State , class Deriv > - void operator()( const State &x_ , Deriv &dxdt_ , double t ) + void operator()( const State &/*x_*/ , Deriv &dxdt_ , double /*t*/ ) { typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ ); @@ -99,7 +99,7 @@ struct system2 } template< class State , class Deriv > - void operator()( const State &x_ , const Deriv &dxdt_ , double t ) + void operator()( const State &/*x_*/ , const Deriv &dxdt_ , double /*t*/ ) { typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ ); @@ -116,7 +116,7 @@ struct system2 struct ham_sys { template< class State , class Deriv > - void operator()( const State &x_ , Deriv &dxdt_ ) + void operator()( const State &/*x_*/ , Deriv &dxdt_ ) { typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ ); dxdt[0] = 1.0; @@ -125,7 +125,7 @@ struct ham_sys } template< class State , class Deriv > - void operator()( const State &x_ , const Deriv &dxdt_ ) + void operator()( const State &/*x_*/ , const Deriv &dxdt_ ) { typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ ); dxdt[0] = 1.0; diff --git a/test/stepper_with_units.cpp b/test/stepper_with_units.cpp index 3e3a64508..877b9c929 100644 --- a/test/stepper_with_units.cpp +++ b/test/stepper_with_units.cpp @@ -65,7 +65,7 @@ typedef units::quantity< si::acceleration , value_type > acceleration_type; typedef fusion::vector< length_type , velocity_type > state_type; typedef fusion::vector< velocity_type , acceleration_type > deriv_type; -void oscillator( const state_type &x , deriv_type &dxdt , time_type t ) +void oscillator( const state_type &x , deriv_type &dxdt , time_type /*t*/ ) { const units::quantity< si::frequency , value_type > omega = 1.0 * si::hertz; fusion::at_c< 0 >( dxdt ) = fusion::at_c< 1 >( x ); @@ -77,12 +77,12 @@ void check_stepper( Stepper &stepper ) { typedef Stepper stepper_type; typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; + //typedef typename stepper_type::value_type value_type; typedef typename stepper_type::deriv_type deriv_type; typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::order_type order_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; + //typedef typename stepper_type::order_type order_type; + //typedef typename stepper_type::algebra_type algebra_type; + //typedef typename stepper_type::operations_type operations_type; const time_type t( 0.0 * si::second ); time_type dt( 0.1 * si::second ); @@ -109,12 +109,12 @@ void check_fsal_stepper( Stepper &stepper ) { typedef Stepper stepper_type; typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; + //typedef typename stepper_type::value_type value_type; typedef typename stepper_type::deriv_type deriv_type; typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::order_type order_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; + //typedef typename stepper_type::order_type order_type; + //typedef typename stepper_type::algebra_type algebra_type; + //typedef typename stepper_type::operations_type operations_type; const time_type t( 0.0 * si::second ); time_type dt( 0.1 * si::second ); @@ -140,12 +140,12 @@ void check_error_stepper( Stepper &stepper ) { typedef Stepper stepper_type; typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; + //typedef typename stepper_type::value_type value_type; typedef typename stepper_type::deriv_type deriv_type; typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::order_type order_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; + //typedef typename stepper_type::order_type order_type; + //typedef typename stepper_type::algebra_type algebra_type; + //typedef typename stepper_type::operations_type operations_type; const time_type t( 0.0 * si::second ); time_type dt( 0.1 * si::second ); @@ -171,12 +171,12 @@ void check_fsal_error_stepper( Stepper &stepper ) { typedef Stepper stepper_type; typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; + //typedef typename stepper_type::value_type value_type; typedef typename stepper_type::deriv_type deriv_type; typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::order_type order_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; + //typedef typename stepper_type::order_type order_type; + //typedef typename stepper_type::algebra_type algebra_type; + //typedef typename stepper_type::operations_type operations_type; const time_type t( 0.0 * si::second ); time_type dt( 0.1 * si::second ); @@ -202,8 +202,8 @@ void check_controlled_stepper( Stepper &stepper ) { typedef Stepper stepper_type; typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; + //typedef typename stepper_type::value_type value_type; + //typedef typename stepper_type::deriv_type deriv_type; typedef typename stepper_type::time_type time_type; time_type t( 0.0 * si::second ); @@ -220,8 +220,8 @@ void check_dense_output_stepper( Stepper &stepper ) { typedef Stepper stepper_type; typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; + //typedef typename stepper_type::value_type value_type; + //typedef typename stepper_type::deriv_type deriv_type; typedef typename stepper_type::time_type time_type; // typedef typename stepper_type::order_type order_type; diff --git a/test/times_time_iterator.cpp b/test/times_time_iterator.cpp index 8b6b29431..6e50facef 100644 --- a/test/times_time_iterator.cpp +++ b/test/times_time_iterator.cpp @@ -51,7 +51,7 @@ typedef mpl::vector< , dummy_dense_output_stepper > dummy_steppers; -std::array times = { 0.0 , 0.1, 0.2, 0.3 }; +std::array times = {{ 0.0 , 0.1, 0.2, 0.3 }}; typedef std::array::iterator time_iterator_type; typedef std::vector< std::pair< state_type , time_type > > result_vector; @@ -83,7 +83,10 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( assignment_stepper_iterator , Stepper , dummy_ste BOOST_CHECK( iter1.same( iter2 ) ); } - +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_iterator_factory , Stepper , dummy_steppers ) { @@ -101,6 +104,10 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_iterator_factory , Stepper , dummy_steppe BOOST_CHECK_CLOSE( x[0] , 1.75 , 1.0e-13 ); } +#if defined(__GNUC__) && __GNUC__ >= 5 +#pragma GCC diagnostic pop +#endif + BOOST_AUTO_TEST_CASE_TEMPLATE( stepper_range , Stepper , dummy_steppers ) { std::cout << "range" << std::endl; diff --git a/test/trivial_state.cpp b/test/trivial_state.cpp index 9976db7fb..53cdb6c2a 100644 --- a/test/trivial_state.cpp +++ b/test/trivial_state.cpp @@ -22,6 +22,11 @@ #pragma warning(disable:4996) #endif +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + #define BOOST_TEST_MODULE odeint_trivial_state #include @@ -46,7 +51,7 @@ namespace mpl = boost::mpl; struct constant_system { template< typename T > - void operator()( const T &x , T &dxdt , const T t ) const + void operator()( const T &/*x*/ , T &dxdt , const T /*t*/ ) const { dxdt = 1.0; } }; @@ -107,3 +112,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( test_integrate , T , error_stepper_types ) } BOOST_AUTO_TEST_SUITE_END() + +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif diff --git a/test/unwrap_boost_reference.cpp b/test/unwrap_boost_reference.cpp index 4106fdf20..8db209a70 100644 --- a/test/unwrap_boost_reference.cpp +++ b/test/unwrap_boost_reference.cpp @@ -22,9 +22,8 @@ using namespace boost::unit_test; template< typename T > -void func( T t ) +void func( T ) { - typedef typename boost::numeric::odeint::unwrap_reference< T >::type type; } BOOST_AUTO_TEST_SUITE( unwrap_boost_reference_test ) diff --git a/test/unwrap_reference.cpp b/test/unwrap_reference.cpp index 7337ddd3a..a1c59913d 100644 --- a/test/unwrap_reference.cpp +++ b/test/unwrap_reference.cpp @@ -24,9 +24,8 @@ using namespace boost::unit_test; template< typename T > -void func( T t ) +void func( T ) { - typedef typename boost::numeric::odeint::unwrap_reference< T >::type type; } BOOST_AUTO_TEST_SUITE( unwrap_reference_test ) diff --git a/test/velocity_verlet.cpp b/test/velocity_verlet.cpp index 93a2e97ca..a1c88456a 100644 --- a/test/velocity_verlet.cpp +++ b/test/velocity_verlet.cpp @@ -74,7 +74,7 @@ struct velocity_verlet_fixture struct ode { template< class CoorIn , class MomentumIn , class AccelerationOut , class Time > - void operator()( const CoorIn &q , const MomentumIn &p , AccelerationOut &a , Time t ) const + void operator()( const CoorIn &q , const MomentumIn &p , AccelerationOut &a , Time /*t*/ ) const { a[0] = -q[0] - p[0]; a[1] = -q[1] - p[1]; @@ -84,7 +84,7 @@ struct ode struct ode_units { - void operator()( coor_vector const &q , velocity_vector const &p , accelartion_vector &a , time_type t ) const + void operator()( coor_vector const &q , velocity_vector const &p , accelartion_vector &a , time_type /*t*/ ) const { const units::quantity< si::frequency , value_type > omega = 1.0 * si::hertz; const units::quantity< si::frequency , value_type > friction = 0.001 * si::hertz;