![]() |
|
|||
File indexing completed on 2025-07-02 08:33:18
0001 #ifndef EIGEN_WARNINGS_DISABLED 0002 #define EIGEN_WARNINGS_DISABLED 0003 0004 #ifdef _MSC_VER 0005 // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p)) 0006 // 4101 - unreferenced local variable 0007 // 4181 - qualifier applied to reference type ignored 0008 // 4211 - nonstandard extension used : redefined extern to static 0009 // 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data 0010 // 4273 - QtAlignedMalloc, inconsistent DLL linkage 0011 // 4324 - structure was padded due to declspec(align()) 0012 // 4503 - decorated name length exceeded, name was truncated 0013 // 4512 - assignment operator could not be generated 0014 // 4522 - 'class' : multiple assignment operators specified 0015 // 4700 - uninitialized local variable 'xyz' used 0016 // 4714 - function marked as __forceinline not inlined 0017 // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow 0018 // 4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning) 0019 #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 0020 #pragma warning( push ) 0021 #endif 0022 #pragma warning( disable : 4100 4101 4181 4211 4244 4273 4324 4503 4512 4522 4700 4714 4717 4800) 0023 0024 #elif defined __INTEL_COMPILER 0025 // 2196 - routine is both "inline" and "noinline" ("noinline" assumed) 0026 // ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body 0027 // typedef that may be a reference type. 0028 // 279 - controlling expression is constant 0029 // ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case. 0030 // 1684 - conversion from pointer to same-sized integral type (potential portability problem) 0031 // 2259 - non-pointer conversion from "Eigen::Index={ptrdiff_t={long}}" to "int" may lose significant bits 0032 #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 0033 #pragma warning push 0034 #endif 0035 #pragma warning disable 2196 279 1684 2259 0036 0037 #elif defined __clang__ 0038 // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant 0039 // this is really a stupid warning as it warns on compile-time expressions involving enums 0040 #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 0041 #pragma clang diagnostic push 0042 #endif 0043 #pragma clang diagnostic ignored "-Wconstant-logical-operand" 0044 #if __clang_major__ >= 3 && __clang_minor__ >= 5 0045 #pragma clang diagnostic ignored "-Wabsolute-value" 0046 #endif 0047 #if __clang_major__ >= 10 0048 #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" 0049 #endif 0050 #if ( defined(__ALTIVEC__) || defined(__VSX__) ) && __cplusplus < 201103L 0051 // warning: generic selections are a C11-specific feature 0052 // ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h 0053 #pragma clang diagnostic ignored "-Wc11-extensions" 0054 #endif 0055 0056 #elif defined __GNUC__ 0057 0058 #if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 0059 #pragma GCC diagnostic push 0060 #endif 0061 // g++ warns about local variables shadowing member functions, which is too strict 0062 #pragma GCC diagnostic ignored "-Wshadow" 0063 #if __GNUC__ == 4 && __GNUC_MINOR__ < 8 0064 // Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions: 0065 #pragma GCC diagnostic ignored "-Wtype-limits" 0066 #endif 0067 #if __GNUC__>=6 0068 #pragma GCC diagnostic ignored "-Wignored-attributes" 0069 #endif 0070 #if __GNUC__==7 0071 // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325 0072 #pragma GCC diagnostic ignored "-Wattributes" 0073 #endif 0074 #endif 0075 0076 #if defined __NVCC__ 0077 #pragma diag_suppress boolean_controlling_expr_is_constant 0078 // Disable the "statement is unreachable" message 0079 #pragma diag_suppress code_is_unreachable 0080 // Disable the "dynamic initialization in unreachable code" message 0081 #pragma diag_suppress initialization_not_reachable 0082 // Disable the "invalid error number" message that we get with older versions of nvcc 0083 #pragma diag_suppress 1222 0084 // 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) 0085 #pragma diag_suppress 2527 0086 #pragma diag_suppress 2529 0087 #pragma diag_suppress 2651 0088 #pragma diag_suppress 2653 0089 #pragma diag_suppress 2668 0090 #pragma diag_suppress 2669 0091 #pragma diag_suppress 2670 0092 #pragma diag_suppress 2671 0093 #pragma diag_suppress 2735 0094 #pragma diag_suppress 2737 0095 #pragma diag_suppress 2739 0096 #endif 0097 0098 #else 0099 // warnings already disabled: 0100 # ifndef EIGEN_WARNINGS_DISABLED_2 0101 # define EIGEN_WARNINGS_DISABLED_2 0102 # elif defined(EIGEN_INTERNAL_DEBUGGING) 0103 # error "Do not include \"DisableStupidWarnings.h\" recursively more than twice!" 0104 # endif 0105 0106 #endif // not EIGEN_WARNINGS_DISABLED
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |