Skip to content

Commit

Permalink
Add more warnings to W3 (#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Aug 5, 2024
2 parents 855e7f4 + 638cbf2 commit 2243398
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
8 changes: 7 additions & 1 deletion cmake/Platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions ql/math/integrals/exponentialintegrals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ namespace QuantLib {
}
return (acc + std::complex<Real>(0.0, sign(z.imag())*M_PI))
- std::exp(z)/ (1.0 - z + ei);

QL_FAIL("series conversion issue for Ei(" << z << ")");
}

std::complex<Real> s(0.0), sn=z;
Expand Down
4 changes: 3 additions & 1 deletion ql/pricingengines/vanilla/analytichestonengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ namespace QuantLib {
sigma2_(sigma_*sigma_),
rsigma_(rho*sigma_),
t0_(kappa - ((j== 1)? rho*sigma : Real(0))),

engine_(engine)
{
}
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion ql/time/ecb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 2243398

Please sign in to comment.