OpenTimelineIO icon indicating copy to clipboard operation
OpenTimelineIO copied to clipboard

Catching polymorphic exception by value

Open meshula opened this issue 4 years ago • 2 comments

Bug Report

Incorrect Functionality

/opt/OpenTimelineIO/source/src/opentime/rationalTime.cpp: In static member function ‘static opentime::v1_0::RationalTime opentime::v1_0::RationalTime::from_timecode(const string&, double, opentime::v1_0::ErrorStatus*)’:
/opt/OpenTimelineIO/source/src/opentime/rationalTime.cpp:110:28: warning: catching polymorphic type ‘class std::exception’ by value [-Wcatch-value=]
  110 |     } catch(std::exception e) {
      |                            ^
/opt/OpenTimelineIO/source/src/opentime/rationalTime.cpp: In static member function ‘static opentime::v1_0::RationalTime opentime::v1_0::RationalTime::from_time_string(const string&, double, opentime::v1_0::ErrorStatus*)’:
/opt/OpenTimelineIO/source/src/opentime/rationalTime.cpp:178:28: warning: catching polymorphic type ‘class std::exception’ by value [-Wcatch-value=]
  178 |     } catch(std::exception e) {
      |     

meshula avatar Oct 28 '20 19:10 meshula

I don't get this with MSVC. Is this with clang or gcc?

KarthikRIyer avatar Oct 28 '20 19:10 KarthikRIyer

It's a gcc warning, and legit, I've got no ranty opinion to go with it ;)

meshula avatar Oct 28 '20 20:10 meshula