Eigen  3.3.3
DisableStupidWarnings.h
00001 #ifndef EIGEN_WARNINGS_DISABLED
00002 #define EIGEN_WARNINGS_DISABLED
00003 
00004 #ifdef _MSC_VER
00005   // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p))
00006   // 4101 - unreferenced local variable
00007   // 4127 - conditional expression is constant
00008   // 4181 - qualifier applied to reference type ignored
00009   // 4211 - nonstandard extension used : redefined extern to static
00010   // 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data
00011   // 4273 - QtAlignedMalloc, inconsistent DLL linkage
00012   // 4324 - structure was padded due to declspec(align())
00013   // 4503 - decorated name length exceeded, name was truncated
00014   // 4512 - assignment operator could not be generated
00015   // 4522 - 'class' : multiple assignment operators specified
00016   // 4700 - uninitialized local variable 'xyz' used
00017   // 4714 - function marked as __forceinline not inlined
00018   // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow
00019   // 4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
00020   #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
00021     #pragma warning( push )
00022   #endif
00023   #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800)
00024 
00025 #elif defined __INTEL_COMPILER
00026   // 2196 - routine is both "inline" and "noinline" ("noinline" assumed)
00027   //        ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body
00028   //        typedef that may be a reference type.
00029   // 279  - controlling expression is constant
00030   //        ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case.
00031   // 1684 - conversion from pointer to same-sized integral type (potential portability problem)
00032   // 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits
00033   #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
00034     #pragma warning push
00035   #endif
00036   #pragma warning disable 2196 279 1684 2259
00037 
00038 #elif defined __clang__
00039   // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
00040   //     this is really a stupid warning as it warns on compile-time expressions involving enums
00041   #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
00042     #pragma clang diagnostic push
00043   #endif
00044   #pragma clang diagnostic ignored "-Wconstant-logical-operand"
00045 
00046 #elif defined __GNUC__ && __GNUC__>=6
00047 
00048   #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
00049     #pragma GCC diagnostic push
00050   #endif
00051   #pragma GCC diagnostic ignored "-Wignored-attributes"
00052 
00053 #endif
00054 
00055 #if defined __NVCC__
00056   // Disable the "statement is unreachable" message
00057   #pragma diag_suppress code_is_unreachable
00058   // Disable the "dynamic initialization in unreachable code" message
00059   #pragma diag_suppress initialization_not_reachable
00060   // Disable the "invalid error number" message that we get with older versions of nvcc
00061   #pragma diag_suppress 1222
00062   // 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)
00063   #pragma diag_suppress 2527
00064   #pragma diag_suppress 2529
00065   #pragma diag_suppress 2651
00066   #pragma diag_suppress 2653
00067   #pragma diag_suppress 2668
00068   #pragma diag_suppress 2669
00069   #pragma diag_suppress 2670
00070   #pragma diag_suppress 2671
00071   #pragma diag_suppress 2735
00072   #pragma diag_suppress 2737
00073 #endif
00074 
00075 #endif // not EIGEN_WARNINGS_DISABLED
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends