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

Add more warnings to W3 #2048

Merged
merged 1 commit into from
Aug 5, 2024
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
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
Loading