diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2011-02-22 10:05:41 -0500 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2011-02-22 10:05:41 -0500 |
commit | c58a2ff03ada9cbdf0519ac0cd91afa46c0d75e0 (patch) | |
tree | 7e56920976798b67bbd756ec8f26ebfbaa3a8338 /Eigen/src/Core/util/DisableStupidWarnings.h | |
parent | 9e1127619c0f6bd6ce00ea2b341238ee7cd2a8f3 (diff) |
add EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS non-default option. Use it in our own CMakeLists. also add a include-guard-like mechanism to prevent doing unmatched #pragma warning push/pop.
Diffstat (limited to 'Eigen/src/Core/util/DisableStupidWarnings.h')
-rw-r--r-- | Eigen/src/Core/util/DisableStupidWarnings.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Eigen/src/Core/util/DisableStupidWarnings.h b/Eigen/src/Core/util/DisableStupidWarnings.h index 01c04abdc..69e557ae5 100644 --- a/Eigen/src/Core/util/DisableStupidWarnings.h +++ b/Eigen/src/Core/util/DisableStupidWarnings.h @@ -1,3 +1,6 @@ +#ifndef EIGEN_WARNINGS_DISABLED +#define EIGEN_WARNINGS_DISABLED + #ifdef _MSC_VER // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p)) // 4101 - unreferenced local variable @@ -11,14 +14,20 @@ // 4522 - 'class' : multiple assignment operators specified // 4700 - uninitialized local variable 'xyz' used // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow - #pragma warning( push ) + #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS + #pragma warning( push ) + #endif #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4512 4522 4700 4717 ) #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 // 2536 - type qualifiers are meaningless here // ICC 12 generates this warning when a function return type is const qualified, even if that type is a template-parameter-dependent - // typedef that may be a reference type - #pragma warning push + // typedef that may be a reference type. + #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS + #pragma warning push + #endif #pragma warning disable 2196 2536 -#endif
\ No newline at end of file +#endif + +#endif // not EIGEN_WARNINGS_DISABLED |