Medial Code Documentation
Loading...
Searching...
No Matches
DisableStupidWarnings.h
1#ifndef EIGEN_WARNINGS_DISABLED
2#define EIGEN_WARNINGS_DISABLED
3
4#ifdef _MSC_VER
5 // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p))
6 // 4101 - unreferenced local variable
7 // 4127 - conditional expression is constant
8 // 4181 - qualifier applied to reference type ignored
9 // 4211 - nonstandard extension used : redefined extern to static
10 // 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data
11 // 4273 - QtAlignedMalloc, inconsistent DLL linkage
12 // 4324 - structure was padded due to declspec(align())
13 // 4503 - decorated name length exceeded, name was truncated
14 // 4512 - assignment operator could not be generated
15 // 4522 - 'class' : multiple assignment operators specified
16 // 4700 - uninitialized local variable 'xyz' used
17 // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow
18 #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
19 #pragma warning( push )
20 #endif
21 #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4503 4512 4522 4700 4717 )
22#elif defined __INTEL_COMPILER
23 // 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
24 // ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
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 // 1684 - conversion from pointer to same-sized integral type (potential portability problem)
29 // 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits
30 #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
31 #pragma warning push
32 #endif
33 #pragma warning disable 2196 279 1684 2259
34#elif defined __clang__
35 // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
36 // this is really a stupid warning as it warns on compile-time expressions involving enums
37 #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
38 #pragma clang diagnostic push
39 #endif
40 #pragma clang diagnostic ignored "-Wconstant-logical-operand"
41
42 #elif defined __GNUC__ && __GNUC__>=6
43
44 #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
45 #pragma GCC diagnostic push
46 #endif
47 #pragma GCC diagnostic ignored "-Wignored-attributes"
48
49#endif
50
51#endif // not EIGEN_WARNINGS_DISABLED