From 0e998d1d41da5076ca9b8396fc649eccba533b33 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Jul 2017 01:27:06 +0200 Subject: [PATCH] Fix unreachable statement warning from MSVC after ICC warning fix Adding a return statement after __assume(0) resulted in "warning C4702: unreachable code" when building with MSVC, which broke the build as warnings are fatal due to the use of /WX options. Fix this by using this return statement only with the Intel compiler, which apparently needs it (see e3f81c436f62c46899037bc8eac4f64de3a12a15). --- Release/include/cpprest/json.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Release/include/cpprest/json.h b/Release/include/cpprest/json.h index c833529850..5f2572ca01 100644 --- a/Release/include/cpprest/json.h +++ b/Release/include/cpprest/json.h @@ -1383,7 +1383,12 @@ namespace json return m_value == other.m_value; } __assume(0); + // Absence of this return statement provokes a warning from Intel + // compiler, but its presence results in a warning from MSVC, so + // we have to resort to conditional compilation to keep both happy. +#ifdef __INTEL_COMPILER return false; +#endif } private: