Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.3.9
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  // 4714 - function marked as __forceinline not inlined
18  // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow
19  // 4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
20  #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
21  #pragma warning( push )
22  #endif
23  #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800)
24 
25 #elif defined __INTEL_COMPILER
26  // 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
27  // ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
28  // typedef that may be a reference type.
29  // 279 - controlling expression is constant
30  // ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case.
31  // 1684 - conversion from pointer to same-sized integral type (potential portability problem)
32  // 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits
33  #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
34  #pragma warning push
35  #endif
36  #pragma warning disable 2196 279 1684 2259
37 
38 #elif defined __clang__
39  // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
40  // this is really a stupid warning as it warns on compile-time expressions involving enums
41  #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
42  #pragma clang diagnostic push
43  #endif
44  #pragma clang diagnostic ignored "-Wconstant-logical-operand"
45 
46 #elif defined __GNUC__
47 
48  #if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
49  #pragma GCC diagnostic push
50  #endif
51  // g++ warns about local variables shadowing member functions, which is too strict
52  #pragma GCC diagnostic ignored "-Wshadow"
53  #if __GNUC__ == 4 && __GNUC_MINOR__ < 8
54  // Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
55  #pragma GCC diagnostic ignored "-Wtype-limits"
56  #endif
57  #if __GNUC__>=6
58  #pragma GCC diagnostic ignored "-Wignored-attributes"
59  #endif
60  #if __GNUC__==7
61  // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
62  #pragma GCC diagnostic ignored "-Wattributes"
63  #endif
64 #endif
65 
66 #if defined __NVCC__
67  // Disable the "statement is unreachable" message
68  #pragma diag_suppress code_is_unreachable
69  // Disable the "dynamic initialization in unreachable code" message
70  #pragma diag_suppress initialization_not_reachable
71  // Disable the "invalid error number" message that we get with older versions of nvcc
72  #pragma diag_suppress 1222
73  // Disable the "calling a __host__ function from a __host__ __device__ function is not allowed" messages (yes, there are many of them and they seem to change with every version of the compiler)
74  #pragma diag_suppress 2527
75  #pragma diag_suppress 2529
76  #pragma diag_suppress 2651
77  #pragma diag_suppress 2653
78  #pragma diag_suppress 2668
79  #pragma diag_suppress 2669
80  #pragma diag_suppress 2670
81  #pragma diag_suppress 2671
82  #pragma diag_suppress 2735
83  #pragma diag_suppress 2737
84 #endif
85 
86 #else
87 // warnings already disabled:
88 # ifndef EIGEN_WARNINGS_DISABLED_2
89 # define EIGEN_WARNINGS_DISABLED_2
90 # elif defined(EIGEN_INTERNAL_DEBUGGING)
91 # error "Do not include \"DisableStupidWarnings.h\" recursively more than twice!"
92 # endif
93 
94 #endif // not EIGEN_WARNINGS_DISABLED