bindings/cxx/classes.cpp: In function ‘int sigrok::call_log_callback(void*, int, const char*, __va_list_tag*)’:
bindings/cxx/classes.cpp:242:17: warning: catching polymorphic type ‘class sigrok::Error’ by value [-Wcatch-value=]
} catch (Error e) {
^
In file included from bindings/cxx/classes.cpp:1667:
bindings/cxx/enums.cpp: In static member function ‘static Glib::VariantBase sigrok::ConfigKey::parse_string(std::__cxx11::string, sr_datatype)’:
bindings/cxx/enums.cpp:789:13: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
} catch (invalid_argument) {
^~~~~~~~~~~~~~~~
bindings/cxx/enums.cpp:804:13: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
} catch (invalid_argument) {
^~~~~~~~~~~~~~~~
case SR_T_FLOAT:
try {
variant = g_variant_new_double(stod(value));
- } catch (invalid_argument) {
+ } catch (invalid_argument&) {
throw Error(SR_ERR_ARG);
}
break;
case SR_T_INT32:
try {
variant = g_variant_new_int32(stoi(value));
- } catch (invalid_argument) {
+ } catch (invalid_argument&) {
throw Error(SR_ERR_ARG);
}
break;
try {
(*callback)(LogLevel::get(loglevel), message.get());
- } catch (Error e) {
+ } catch (Error &e) {
return e.result;
}