Skip to content

Commit

Permalink
Disable array-bounds warning in workflow.
Browse files Browse the repository at this point in the history
This prevents us from playing whack-a-mole with warnings while
we investigate.
  • Loading branch information
lballabio committed Oct 2, 2023
1 parent 4a1fe40 commit 751144f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-nondefault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
tag: rolling
cc: gcc
cxx: g++
cxxflags: "-std=c++17"
cxxflags: "-std=c++17 -Wno-array-bounds"
configureflags: --disable-std-function --disable-std-tuple --enable-std-pointers --enable-std-any --enable-std-optional
- name: "OpenMP enabled"
shortname: openmp
Expand Down
9 changes: 0 additions & 9 deletions Examples/BermudanSwaption/BermudanSwaption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@ int main(int, char* []) {
Size k = i*numCols + j;
auto vol = ext::make_shared<SimpleQuote>(swaptionVols[k]);

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif

swaptions.push_back(ext::make_shared<SwaptionHelper>(
swaptionMaturities[i],
Period(swapLengths[j], Years),
Expand All @@ -187,10 +182,6 @@ int main(int, char* []) {
indexSixMonths->dayCounter(),
rhTermStructure));

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif

swaptions.back()->addTimesTo(times);
}

Expand Down
10 changes: 0 additions & 10 deletions ql/models/shortrate/calibrationhelpers/swaptionhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <ql/time/schedule.hpp>
#include <utility>


namespace QuantLib {

SwaptionHelper::SwaptionHelper(const Period& maturity,
Expand Down Expand Up @@ -191,17 +190,8 @@ namespace QuantLib {

ext::shared_ptr<Exercise> exercise(new EuropeanExercise(exerciseDate));

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif

swaption_ = ext::make_shared<Swaption>(swap_, exercise);

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif

BlackCalibrationHelper::performCalculations();

}
Expand Down
19 changes: 0 additions & 19 deletions test-suite/bermudanswaption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,8 @@ void BermudanSwaptionTest::testCachedG2Values() {
exerciseDates.push_back(ext::dynamic_pointer_cast<Coupon>(i)->accrualStartDate());
}

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif

swaptions.push_back(ext::make_shared<Swaption>(swap,
ext::make_shared<BermudanExercise>(exerciseDates)));

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif

}

const Real a=0.1, sigma=0.01, b=0.2, eta=0.013, rho=-0.5;
Expand Down Expand Up @@ -355,17 +345,8 @@ void BermudanSwaptionTest::testTreeEngineTimeSnapping() {
auto callDate = initialCallDate + i * Days;
if (calendar.isBusinessDay(callDate)) {

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif

auto bermudanSwaption = makeBermudanSwaption(callDate);

#if defined(__GNUC__) && (__GNUC__ >= 12)
#pragma GCC diagnostic pop
#endif

auto model = ext::make_shared<HullWhite>(termStructure);

bermudanSwaption->setPricingEngine(ext::make_shared<FdHullWhiteSwaptionEngine>(model));
Expand Down

0 comments on commit 751144f

Please sign in to comment.