diff --git a/example/issues.cpp b/example/issues.cpp index dfe20fff8..d75da1cef 100644 --- a/example/issues.cpp +++ b/example/issues.cpp @@ -135,7 +135,7 @@ void init_issues(py::module &m) { try { py::class_(m2, "Placeholder"); throw std::logic_error("Expected an exception!"); - } catch (std::runtime_error &e) { + } catch (std::runtime_error &) { /* All good */ } } diff --git a/include/pybind11/descr.h b/include/pybind11/descr.h index 1b65f68c8..6c1d86432 100644 --- a/include/pybind11/descr.h +++ b/include/pybind11/descr.h @@ -139,7 +139,7 @@ protected: const T *it = ptr; while (*it++ != (T) 0) ; - return it - ptr; + return static_cast(it - ptr); } const std::type_info **m_types = nullptr;