From 16a832bc5bb4cce24598537c99e0655edb65c1d0 Mon Sep 17 00:00:00 2001 From: Brian Starkey Date: Sat, 21 Jul 2018 18:08:45 +0100 Subject: [PATCH] Fix the build - catch exceptions by reference MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix the following build errors seen with gcc 8.1.1: error: catching polymorphic type ‘class std::out_of_range’ by value error: catching polymorphic type ‘class boost::archive::archive_exception’ by value Signed-off-by: Brian Starkey --- pv/devices/inputfile.cpp | 2 +- pv/views/trace/analogsignal.cpp | 2 +- pv/views/trace/view.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 8e973f05..46886ed5 100644 --- a/pv/devices/inputfile.cpp +++ b/pv/devices/inputfile.cpp @@ -86,7 +86,7 @@ InputFile::InputFile(const shared_ptr &context, settings.endGroup(); } - } catch (out_of_range) { + } catch (out_of_range&) { qWarning() << "Could not find input format" << format_name << "needed to restore session input file"; } diff --git a/pv/views/trace/analogsignal.cpp b/pv/views/trace/analogsignal.cpp index 2a2e2305..0994d92e 100644 --- a/pv/views/trace/analogsignal.cpp +++ b/pv/views/trace/analogsignal.cpp @@ -1013,7 +1013,7 @@ void AnalogSignal::hover_point_changed(const QPoint &hp) } else { try { value_at_hover_pos_ = value_at_pixel_pos_.at(hp.x()); - } catch (out_of_range) { + } catch (out_of_range&) { value_at_hover_pos_ = std::numeric_limits::quiet_NaN(); } } diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index 0070c743..98fd46d2 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -385,7 +385,7 @@ void View::restore_settings(QSettings &settings) boost::archive::text_iarchive ia(ss); ia >> boost::serialization::make_nvp("ruler_shift", shift); ruler_shift_ = shift; - } catch (boost::archive::archive_exception) { + } catch (boost::archive::archive_exception&) { qDebug() << "Could not restore the view ruler shift"; } } @@ -400,7 +400,7 @@ void View::restore_settings(QSettings &settings) ia >> boost::serialization::make_nvp("offset", offset); // This also updates ruler_offset_ set_offset(offset); - } catch (boost::archive::archive_exception) { + } catch (boost::archive::archive_exception&) { qDebug() << "Could not restore the view offset"; } } -- 2.30.2