diff --git a/cmake/Platform.cmake b/cmake/Platform.cmake index 86f70ada10e..13774663e2e 100644 --- a/cmake/Platform.cmake +++ b/cmake/Platform.cmake @@ -32,7 +32,13 @@ if (MSVC) # /w34127 # Enable warning under W3: conditional expression is constant - add_compile_options(/wd4267 /wd4819 /wd26812 /w34127) + # /w34702 + # Enable warning under W3: unreachable code + + # /w35262 + # Enable warning under W3: implicit fall-through occurs here; are you missing a break statement? + + add_compile_options(/wd4267 /wd4819 /wd26812 /w34127 /w34702 /w35262) # Silence all C++17 deprecation warnings, same as in the vcxproj files add_compile_definitions(_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS) diff --git a/ql/math/integrals/exponentialintegrals.cpp b/ql/math/integrals/exponentialintegrals.cpp index 18ce21ff387..99c6d9ad0af 100644 --- a/ql/math/integrals/exponentialintegrals.cpp +++ b/ql/math/integrals/exponentialintegrals.cpp @@ -170,8 +170,6 @@ namespace QuantLib { } return (acc + std::complex(0.0, sign(z.imag())*M_PI)) - std::exp(z)/ (1.0 - z + ei); - - QL_FAIL("series conversion issue for Ei(" << z << ")"); } std::complex s(0.0), sn=z; diff --git a/ql/pricingengines/vanilla/analytichestonengine.cpp b/ql/pricingengines/vanilla/analytichestonengine.cpp index f375a6f07a1..1dd91a653f7 100644 --- a/ql/pricingengines/vanilla/analytichestonengine.cpp +++ b/ql/pricingengines/vanilla/analytichestonengine.cpp @@ -175,7 +175,7 @@ namespace QuantLib { sigma2_(sigma_*sigma_), rsigma_(rho*sigma_), t0_(kappa - ((j== 1)? rho*sigma : Real(0))), - + engine_(engine) { } @@ -488,9 +488,11 @@ namespace QuantLib { *(v0 + kappa*theta*term) - 2*kappa*theta*std::atan(rho/std::sqrt(1-rho*rho)))) /(sigma*sigma); + [[fallthrough]]; case AngledContour: vAvg_ = (1-std::exp(-kappa*term))*(v0 - theta) /(kappa*term) + theta; + [[fallthrough]]; case AngledContourNoCV: { const Real r = rho - sigma*freq_ / (v0 + kappa*theta*term); diff --git a/ql/time/ecb.cpp b/ql/time/ecb.cpp index 71bea514671..0009ee94a91 100644 --- a/ql/time/ecb.cpp +++ b/ql/time/ecb.cpp @@ -303,7 +303,6 @@ namespace QuantLib { if (incrementAndCheckForOverlow(nextCodeStr[4])) incrementAndCheckForOverlow(nextCodeStr[3]); } - return nextCodeStr; #if defined(QL_EXTRA_SAFETY_CHECKS) QL_ENSURE(isECBcode(nextCodeStr),