Skip to content

Commit

Permalink
Avoid warnings from g++ 12
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Sep 14, 2022
1 parent 7e2d80f commit 06bf775
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
7 changes: 7 additions & 0 deletions ql/experimental/models/hestonslvmcmodel.cpp
Expand Up @@ -25,7 +25,14 @@
#include <ql/termstructures/volatility/equityfx/fixedlocalvolsurface.hpp>
#include <ql/experimental/models/hestonslvmcmodel.hpp>
#include <ql/experimental/processes/hestonslvprocess.hpp>

#pragma push_macro("BOOST_DISABLE_ASSERTS")
#ifndef BOOST_DISABLE_ASSERTS
#define BOOST_DISABLE_ASSERTS
#endif
#include <boost/multi_array.hpp>
#pragma pop_macro("BOOST_DISABLE_ASSERTS")

#include <utility>

namespace QuantLib {
Expand Down
6 changes: 2 additions & 4 deletions ql/math/array.hpp
Expand Up @@ -242,10 +242,8 @@ namespace QuantLib {

inline Array::Array(const Array& from)
: data_(from.n_ != 0U ? new Real[from.n_] : (Real*)nullptr), n_(from.n_) {
#if defined(QL_PATCH_MSVC) && defined(QL_DEBUG)
if (n_)
#endif
std::copy(from.begin(),from.end(),begin());
if (data_)
std::copy(from.begin(),from.end(),begin());
}

inline Array::Array(Array&& from) noexcept
Expand Down
Expand Up @@ -21,10 +21,13 @@

#include <ql/methods/finitedifferences/operators/numericaldifferentiation.hpp>

#ifndef QL_EXTRA_SAFETY_CHECKS
#define BOOST_DISABLE_ASSERTS 1
#pragma push_macro("BOOST_DISABLE_ASSERTS")
#ifndef BOOST_DISABLE_ASSERTS
#define BOOST_DISABLE_ASSERTS
#endif
#include <boost/multi_array.hpp>
#pragma pop_macro("BOOST_DISABLE_ASSERTS")

#include <utility>

namespace QuantLib {
Expand Down
2 changes: 1 addition & 1 deletion ql/methods/finitedifferences/tridiagonaloperator.hpp
Expand Up @@ -123,7 +123,7 @@ namespace QuantLib {

// inline definitions

inline TridiagonalOperator::TridiagonalOperator(TridiagonalOperator&& from) noexcept {
inline TridiagonalOperator::TridiagonalOperator(TridiagonalOperator&& from) noexcept : n_(0) {
swap(from);
}

Expand Down
2 changes: 1 addition & 1 deletion ql/models/marketmodels/pathwisemultiproduct.hpp
Expand Up @@ -54,7 +54,7 @@ namespace QuantLib {
{
public:
struct CashFlow {
Size timeIndex;
Size timeIndex = 0;
std::vector<Real > amount;
};
virtual ~MarketModelPathwiseMultiProduct() = default;
Expand Down

0 comments on commit 06bf775

Please sign in to comment.