2011-02-22 23:05:41 +08:00
|
|
|
#ifndef EIGEN_WARNINGS_DISABLED
|
|
|
|
|
#define EIGEN_WARNINGS_DISABLED
|
|
|
|
|
|
2008-12-19 05:04:06 +08:00
|
|
|
#ifdef _MSC_VER
|
2009-12-12 21:49:43 +08:00
|
|
|
// 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p))
|
2009-12-14 17:32:43 +08:00
|
|
|
// 4101 - unreferenced local variable
|
2010-06-25 19:31:07 +08:00
|
|
|
// 4127 - conditional expression is constant
|
|
|
|
|
// 4181 - qualifier applied to reference type ignored
|
|
|
|
|
// 4211 - nonstandard extension used : redefined extern to static
|
|
|
|
|
// 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data
|
|
|
|
|
// 4273 - QtAlignedMalloc, inconsistent DLL linkage
|
2010-06-09 02:21:55 +08:00
|
|
|
// 4324 - structure was padded due to declspec(align())
|
2015-11-23 22:03:24 +08:00
|
|
|
// 4503 - decorated name length exceeded, name was truncated
|
2009-12-14 17:32:43 +08:00
|
|
|
// 4512 - assignment operator could not be generated
|
2010-06-25 19:31:07 +08:00
|
|
|
// 4522 - 'class' : multiple assignment operators specified
|
2011-02-13 01:48:57 +08:00
|
|
|
// 4700 - uninitialized local variable 'xyz' used
|
2010-06-25 19:31:07 +08:00
|
|
|
// 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow
|
2016-01-28 19:14:16 +08:00
|
|
|
// 4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
|
2011-02-22 23:05:41 +08:00
|
|
|
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
|
|
|
|
|
#pragma warning( push )
|
|
|
|
|
#endif
|
2016-01-28 19:14:16 +08:00
|
|
|
#pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4503 4512 4522 4700 4717 4800)
|
2016-02-04 04:51:19 +08:00
|
|
|
|
2011-02-22 22:31:22 +08:00
|
|
|
#elif defined __INTEL_COMPILER
|
|
|
|
|
// 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
|
|
|
|
|
// ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
|
2011-02-22 23:05:41 +08:00
|
|
|
// typedef that may be a reference type.
|
2011-03-07 08:06:44 +08:00
|
|
|
// 279 - controlling expression is constant
|
|
|
|
|
// ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case.
|
2015-12-11 17:55:07 +08:00
|
|
|
// 1684 - conversion from pointer to same-sized integral type (potential portability problem)
|
|
|
|
|
// 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits
|
2011-02-22 23:05:41 +08:00
|
|
|
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
|
|
|
|
|
#pragma warning push
|
|
|
|
|
#endif
|
2015-12-11 17:55:07 +08:00
|
|
|
#pragma warning disable 2196 279 1684 2259
|
2016-02-04 04:51:19 +08:00
|
|
|
|
2011-02-28 09:18:03 +08:00
|
|
|
#elif defined __clang__
|
|
|
|
|
// -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
|
|
|
|
|
// this is really a stupid warning as it warns on compile-time expressions involving enums
|
|
|
|
|
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
|
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
|
#endif
|
|
|
|
|
#pragma clang diagnostic ignored "-Wconstant-logical-operand"
|
2016-05-19 21:21:53 +08:00
|
|
|
|
|
|
|
|
#elif defined __GNUC__ && __GNUC__>=6
|
|
|
|
|
|
|
|
|
|
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
#endif
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wignored-attributes"
|
|
|
|
|
|
2016-02-10 12:55:50 +08:00
|
|
|
#endif
|
2016-02-04 04:51:19 +08:00
|
|
|
|
2016-02-10 12:55:50 +08:00
|
|
|
#if defined __NVCC__
|
2016-02-04 06:12:18 +08:00
|
|
|
// Disable the "statement is unreachable" message
|
2016-02-04 04:51:19 +08:00
|
|
|
#pragma diag_suppress code_is_unreachable
|
2016-02-04 06:12:18 +08:00
|
|
|
// Disable the "dynamic initialization in unreachable code" message
|
2016-02-04 06:10:06 +08:00
|
|
|
#pragma diag_suppress initialization_not_reachable
|
2016-02-04 08:01:37 +08:00
|
|
|
// Disable the "calling a __host__ function from a __host__ __device__ function is not allowed" messages (yes, there are 4 of them)
|
2016-09-14 03:42:13 +08:00
|
|
|
#pragma diag_suppress 1222
|
2016-02-04 06:10:06 +08:00
|
|
|
#pragma diag_suppress 2651
|
|
|
|
|
#pragma diag_suppress 2653
|
2016-02-04 08:01:37 +08:00
|
|
|
#pragma diag_suppress 2668
|
2016-05-28 05:40:49 +08:00
|
|
|
#pragma diag_suppress 2669
|
2016-02-04 08:01:37 +08:00
|
|
|
#pragma diag_suppress 2670
|
2016-05-28 05:40:49 +08:00
|
|
|
#pragma diag_suppress 2671
|
2011-02-22 23:05:41 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif // not EIGEN_WARNINGS_DISABLED
|