Commit cb637709 by Jason Rhinelander Committed by Wenzel Jakob

Silence warnings from eigen under g++ 7

-Wint-in-bool-context triggers many warnings when compiling eigen code,
so disable it locally in eigen.h.
parent f4b81b36
...@@ -17,18 +17,17 @@ ...@@ -17,18 +17,17 @@
# pragma GCC diagnostic push # pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion" # pragma GCC diagnostic ignored "-Wconversion"
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
# if __GNUC__ >= 7
# pragma GCC diagnostic ignored "-Wint-in-bool-context"
# endif
#endif #endif
#include <Eigen/Core> #include <Eigen/Core>
#include <Eigen/SparseCore> #include <Eigen/SparseCore>
#if defined(__GNUG__) || defined(__clang__)
# pragma GCC diagnostic pop
#endif
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning(push) # pragma warning(push)
#pragma warning(disable: 4127) // warning C4127: Conditional expression is constant # pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
#endif #endif
NAMESPACE_BEGIN(pybind11) NAMESPACE_BEGIN(pybind11)
...@@ -234,6 +233,8 @@ struct type_caster<Type, enable_if_t<is_eigen_sparse<Type>::value>> { ...@@ -234,6 +233,8 @@ struct type_caster<Type, enable_if_t<is_eigen_sparse<Type>::value>> {
NAMESPACE_END(detail) NAMESPACE_END(detail)
NAMESPACE_END(pybind11) NAMESPACE_END(pybind11)
#if defined(_MSC_VER) #if defined(__GNUG__) || defined(__clang__)
#pragma warning(pop) # pragma GCC diagnostic pop
#elif defined(_MSC_VER)
# pragma warning(pop)
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment