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 <star...@gmail.com>

---

Hi,

I hit some build errors with the git tree. One seems to be an upstream
bug in libsigc++ which is fixed but the fix didn't reach my machine
yet[1].

The other is these exceptions being caught by value which my gcc doesn't
like.

Cheers,
-Brian

[1] https://github.com/libsigcplusplus/libsigcplusplus/issues/1

 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 8e973f0..46886ed 100644
--- a/pv/devices/inputfile.cpp
+++ b/pv/devices/inputfile.cpp
@@ -86,7 +86,7 @@ InputFile::InputFile(const shared_ptr<sigrok::Context> 
&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 1c0f0ef..f841969 100644
--- a/pv/views/trace/analogsignal.cpp
+++ b/pv/views/trace/analogsignal.cpp
@@ -1036,7 +1036,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<float>::quiet_NaN();
                }
        }
diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp
index 96b17fd..b74737d 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.18.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to