Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable 4611 and 4703 #66792

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,7 @@ if (MSVC)
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)
Expand Down
17 changes: 17 additions & 0 deletions src/coreclr/vm/fcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,21 @@ class CompletedFCallTransitionState
#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) \
{ \
Expand All @@ -318,7 +333,9 @@ class CompletedFCallTransitionState
else \
{ \
jmp_buf ___jmpbuf; \
DISABLE_4611() \
setjmp(___jmpbuf); \
RESET_4611() \
__assume(0); \
}

Expand Down