From 3dce51bd8eb2cf1e809efac1fc9fbaa6e836655c Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Sat, 12 Dec 2009 14:49:43 +0100 Subject: [PATCH] Removed more warnings. --- Eigen/src/Core/Functors.h | 4 ++++ Eigen/src/Core/PermutationMatrix.h | 3 +++ Eigen/src/Core/util/DisableMSVCWarnings.h | 6 ++++-- Eigen/src/Sparse/DynamicSparseMatrix.h | 3 +++ Eigen/src/Sparse/SparseCwiseBinaryOp.h | 3 +++ cmake/EigenTesting.cmake | 4 +++- test/unalignedassert.cpp | 1 + 7 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h index 259f40244..e2a212c89 100644 --- a/Eigen/src/Core/Functors.h +++ b/Eigen/src/Core/Functors.h @@ -365,6 +365,8 @@ struct ei_scalar_multiple2_op { EIGEN_STRONG_INLINE ei_scalar_multiple2_op(const Scalar2& other) : m_other(other) { } EIGEN_STRONG_INLINE result_type operator() (const Scalar1& a) const { return a * m_other; } typename ei_makeconst::Nested>::type m_other; +private: + ei_scalar_multiple2_op& operator=(ei_scalar_multiple2_op&); }; template struct ei_functor_traits > @@ -394,6 +396,8 @@ struct ei_scalar_quotient1_impl { EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {} EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; } typename ei_makeconst::Nested>::type m_other; +private: + ei_scalar_quotient1_impl& operator=(const ei_scalar_quotient1_impl&); }; template struct ei_functor_traits > diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h index 284baf678..4d30b2dac 100644 --- a/Eigen/src/Core/PermutationMatrix.h +++ b/Eigen/src/Core/PermutationMatrix.h @@ -320,6 +320,9 @@ struct ei_permut_matrix_product_retval protected: const PermutationType& m_permutation; const typename MatrixType::Nested m_matrix; + + private: + ei_permut_matrix_product_retval& operator=(ei_permut_matrix_product_retval&); }; #endif // EIGEN_PERMUTATIONMATRIX_H diff --git a/Eigen/src/Core/util/DisableMSVCWarnings.h b/Eigen/src/Core/util/DisableMSVCWarnings.h index c08d0389f..18484e490 100644 --- a/Eigen/src/Core/util/DisableMSVCWarnings.h +++ b/Eigen/src/Core/util/DisableMSVCWarnings.h @@ -1,6 +1,8 @@ #ifdef _MSC_VER - // 4273 - QtAlignedMalloc, inconsistent dll linkage + // 4273 - QtAlignedMalloc, inconsistent DLL linkage + // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p)) + // 4101 - we need this one for the inlining fix #pragma warning( push ) - #pragma warning( disable : 4181 4244 4127 4211 4273 4522 4717 ) + #pragma warning( disable : 4100 4101 4181 4244 4127 4211 4273 4522 4717 ) #endif diff --git a/Eigen/src/Sparse/DynamicSparseMatrix.h b/Eigen/src/Sparse/DynamicSparseMatrix.h index f4f83533a..00386442c 100644 --- a/Eigen/src/Sparse/DynamicSparseMatrix.h +++ b/Eigen/src/Sparse/DynamicSparseMatrix.h @@ -323,6 +323,9 @@ class DynamicSparseMatrix::InnerIterator : public SparseVector, LhsIterator m_lhsIter; const BinaryFunc m_functor; const int m_outer; + +private: + ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(ei_sparse_cwise_binary_op_inner_iterator_selector&); }; // sparse - dense (product) diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake index bb1da41de..b8cd63ac1 100644 --- a/cmake/EigenTesting.cmake +++ b/cmake/EigenTesting.cmake @@ -237,6 +237,8 @@ if(CMAKE_COMPILER_IS_GNUCXX) elseif(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS") if(EIGEN_TEST_MAX_WARNING_LEVEL) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + # C4127 - conditional expression is constant + # C4505 - unreferenced local function has been removed + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4127 /wd4505") endif(EIGEN_TEST_MAX_WARNING_LEVEL) endif(CMAKE_COMPILER_IS_GNUCXX) diff --git a/test/unalignedassert.cpp b/test/unalignedassert.cpp index 2b819417e..c3a07d195 100644 --- a/test/unalignedassert.cpp +++ b/test/unalignedassert.cpp @@ -87,6 +87,7 @@ void construct_at_boundary(int boundary) _buf += (16 - (_buf % 16)); // make 16-byte aligned _buf += boundary; // make exact boundary-aligned T *x = ::new(reinterpret_cast(_buf)) T; + x[0]; // just in order to silence warnings x->~T(); } #endif