From 3ed919e0edebc9aebc28c03168d40e720214733e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 22 Jun 2013 10:19:50 +0200 Subject: [PATCH] Fix an shut down a few ICC's remarks --- test/main.h | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/test/main.h b/test/main.h index fefeac358..b3ed96000 100644 --- a/test/main.h +++ b/test/main.h @@ -297,7 +297,7 @@ inline bool test_isUnitary(const MatrixBase& m) } template -bool test_is_equal(const T& actual, const U& expected) +static bool test_is_equal(const T& actual, const U& expected) { if (actual==expected) return true; @@ -314,7 +314,7 @@ bool test_is_equal(const T& actual, const U& expected) * This is very useful to test rank-revealing algorithms. */ template -void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typename MatrixType::Index rows, typename MatrixType::Index cols, MatrixType& m) +static void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typename MatrixType::Index rows, typename MatrixType::Index cols, MatrixType& m) { typedef typename internal::traits::Index Index; typedef typename internal::traits::Scalar Scalar; @@ -352,7 +352,7 @@ void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typenam } template -void randomPermutationVector(PermutationVectorType& v, typename PermutationVectorType::Index size) +static void randomPermutationVector(PermutationVectorType& v, typename PermutationVectorType::Index size) { typedef typename PermutationVectorType::Index Index; typedef typename PermutationVectorType::Scalar Scalar; @@ -377,20 +377,20 @@ template<> struct GetDifferentType { typedef float type; }; template struct GetDifferentType > { typedef std::complex::type> type; }; -template std::string type_name() { return "other"; } -template<> std::string type_name() { return "float"; } -template<> std::string type_name() { return "double"; } -template<> std::string type_name() { return "int"; } -template<> std::string type_name >() { return "complex"; } -template<> std::string type_name >() { return "complex"; } -template<> std::string type_name >() { return "complex"; } +template static std::string type_name() { return "other"; } +template<> static std::string type_name() { return "float"; } +template<> static std::string type_name() { return "double"; } +template<> static std::string type_name() { return "int"; } +template<> static std::string type_name >() { return "complex"; } +template<> static std::string type_name >() { return "complex"; } +template<> static std::string type_name >() { return "complex"; } // forward declaration of the main test function void EIGEN_CAT(test_,EIGEN_TEST_FUNC)(); using namespace Eigen; -void set_repeat_from_string(const char *str) +static void set_repeat_from_string(const char *str) { errno = 0; g_repeat = int(strtoul(str, 0, 10)); @@ -402,7 +402,7 @@ void set_repeat_from_string(const char *str) g_has_set_repeat = true; } -void set_seed_from_string(const char *str) +static void set_seed_from_string(const char *str) { errno = 0; g_seed = int(strtoul(str, 0, 10)); @@ -474,8 +474,17 @@ int main(int argc, char *argv[]) srand(g_seed); std::cout << "Repeating each test " << g_repeat << " times" << std::endl; - Eigen::g_test_stack.push_back(EI_PP_MAKE_STRING(EIGEN_TEST_FUNC)); + Eigen::g_test_stack.push_back(std::string(EI_PP_MAKE_STRING(EIGEN_TEST_FUNC))); EIGEN_CAT(test_,EIGEN_TEST_FUNC)(); return 0; } + +// These warning are disabled here such that they are still ON when parsing Eigen's header files. +#if defined __INTEL_COMPILER + // remark #383: value copied to temporary, reference to temporary used + // -> this warning is raised even for legal usage as: g_test_stack.push_back("foo"); where g_test_stack is a std::vector + // remark #1418: external function definition with no prior declaration + // -> this warning is raised for all our test functions. Declaring them static would fix the issue. + #pragma warning disable 383 1418 +#endif