/src/Geometry_Eigen/Eigen/src/Core/util/DisableStupidWarnings.h

http://github.com/Akranar/daguerreo · C Header · 42 lines · 19 code · 2 blank · 21 comment · 0 complexity · 963379330c1953d16f5a7f0af9948163 MD5 · raw file

  1. #ifndef EIGEN_WARNINGS_DISABLED
  2. #define EIGEN_WARNINGS_DISABLED
  3. #ifdef _MSC_VER
  4. // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p))
  5. // 4101 - unreferenced local variable
  6. // 4127 - conditional expression is constant
  7. // 4181 - qualifier applied to reference type ignored
  8. // 4211 - nonstandard extension used : redefined extern to static
  9. // 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data
  10. // 4273 - QtAlignedMalloc, inconsistent DLL linkage
  11. // 4324 - structure was padded due to declspec(align())
  12. // 4512 - assignment operator could not be generated
  13. // 4522 - 'class' : multiple assignment operators specified
  14. // 4700 - uninitialized local variable 'xyz' used
  15. // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow
  16. #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
  17. #pragma warning( push )
  18. #endif
  19. #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4512 4522 4700 4717 )
  20. #elif defined __INTEL_COMPILER
  21. // 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
  22. // ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
  23. // 2536 - type qualifiers are meaningless here
  24. // ICC 12 generates this warning when a function return type is const qualified, even if that type is a template-parameter-dependent
  25. // typedef that may be a reference type.
  26. // 279 - controlling expression is constant
  27. // ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case.
  28. #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
  29. #pragma warning push
  30. #endif
  31. #pragma warning disable 2196 2536 279
  32. #elif defined __clang__
  33. // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
  34. // this is really a stupid warning as it warns on compile-time expressions involving enums
  35. #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
  36. #pragma clang diagnostic push
  37. #endif
  38. #pragma clang diagnostic ignored "-Wconstant-logical-operand"
  39. #endif
  40. #endif // not EIGEN_WARNINGS_DISABLED