add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4459>) # declaration of 'identifier' hides global declaration
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4463>) # overflow; assigning value to bit-field that can only hold values from low_value to high_value
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4505>) # unreferenced function with internal linkage has been removed
- add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4611>) # interaction between 'function' and C++ object destruction is non-portable
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4702>) # unreachable code
- add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4703>) # potentially uninitialized local pointer variable 'var' used
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4706>) # assignment within conditional expression
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4733>) # Inline asm assigning to 'FS:0' : handler not registered as safe handler
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4815>) # 'var': zero-sized array in stack object will have no elements (unless the object is an aggregate that has been aggregate initialized)
#endif // _DEBUG
};
+// These macros are used to narrowly suppress
+// warning 4611 - interaction between 'function' and C++ object destruction is non-portable
+// See usage of setjmp() and inclusion of setjmp.h for reasoning behind usage.
+#ifdef _MSC_VER
+#define DISABLE_4611() \
+ _Pragma("warning(push)") \
+ _Pragma("warning(disable:4611)")
+
+#define RESET_4611() \
+ _Pragma("warning(pop)")
+#else
+#define DISABLE_4611()
+#define RESET_4611()
+#endif // _MSC_VER
+
#define PERMIT_HELPER_METHOD_FRAME_BEGIN() \
if (1) \
{ \
else \
{ \
jmp_buf ___jmpbuf; \
+ DISABLE_4611() \
setjmp(___jmpbuf); \
+ RESET_4611() \
__assume(0); \
}