From e4ec63aee7233f5b934abc0b1d9ceada79a844ee Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 24 Jan 2013 11:59:17 +0100 Subject: Suppress annoying "may be used uninitialized in this function" warning with gcc >= 4.6 --- Eigen/src/Core/arch/SSE/Complex.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Eigen/src/Core/arch/SSE/Complex.h') diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h index 12df98775..bd76d75ed 100644 --- a/Eigen/src/Core/arch/SSE/Complex.h +++ b/Eigen/src/Core/arch/SSE/Complex.h @@ -87,12 +87,18 @@ template<> EIGEN_STRONG_INLINE Packet2cf ploadu(const std::complex EIGEN_STRONG_INLINE Packet2cf pset1(const std::complex& from) { Packet2cf res; - #if EIGEN_GNUC_AT_MOST(4,2) - // workaround annoying "may be used uninitialized in this function" warning with gcc 4.2 +#if EIGEN_GNUC_AT_MOST(4,2) + // Workaround annoying "may be used uninitialized in this function" warning with gcc 4.2 res.v = _mm_loadl_pi(_mm_set1_ps(0.0f), reinterpret_cast(&from)); - #else +#elif EIGEN_GNUC_AT_LEAST(4,6) + // Suppress annoying "may be used uninitialized in this function" warning with gcc >= 4.6 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wuninitialized" res.v = _mm_loadl_pi(res.v, (const __m64*)&from); - #endif + #pragma GCC diagnostic pop +#else + res.v = _mm_loadl_pi(res.v, (const __m64*)&from); +#endif return Packet2cf(_mm_movelh_ps(res.v,res.v)); } -- cgit v1.2.3