Conditionally disable C4702 "unreachable code" warnings
authorBruce Forstall <brucefo@microsoft.com>
Tue, 23 Aug 2016 00:34:44 +0000 (17:34 -0700)
committerBruce Forstall <brucefo@microsoft.com>
Tue, 23 Aug 2016 00:34:44 +0000 (17:34 -0700)
commit1daba4acb6370ca3c3a87ee61c0e61a527a89275
tree1c7774057666a5a0b9abdf27b71236a30260e820
parentdf685c925903c75ae259df214012aa5a2ea9462f
Conditionally disable C4702 "unreachable code" warnings

The CLR header file check.h, macro CHECK_MSG_EX, can create unreachable code if the LEAVE_DEBUG_ONLY_CODE
macro is not empty (such as it is defined in contract.h) and the _RESULT macro expands to "return".
Checked-in compilers used by the TFS-based desktop build (e.g., version 18.10.40116.8) started reporting
unreachable code warnings when debugholder.h was changed to no longer #define "return" to something relatively
complex. However, newer compilers, such as Visual Studio 2015, used to build the CLR from the open source
GitHub repo, still do not report this warning. We don't want to disable this warning for the open source build,
which will use a newer compiler. Hence, only disable it for older compilers.

Commit migrated from https://github.com/dotnet/coreclr/commit/c3fa47e14b09cd461f723bdc6306e74f98eede4f
src/coreclr/src/inc/warningcontrol.h