diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 9679c5002..eab3e1c0d 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -605,7 +605,7 @@ struct instance { bool simple_instance_registered : 1; /// If true, get_internals().patients has an entry for this object bool has_patients : 1; -// Cannot use PYBIND11_INTERNALS_VERSION >= 6 here without refactoring. +// Cannot use PYBIND11_INTERNALS_VERSION >= 106 here without refactoring. #if PYBIND11_VERSION_MAJOR >= 3 /// If true, this Python object needs to be kept alive for the lifetime of the C++ value. bool is_alias : 1; diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index 1bbd0e327..892e611d6 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -38,23 +38,17 @@ /// changed to the new version. #ifndef PYBIND11_INTERNALS_VERSION # if PYBIND11_VERSION_MAJOR >= 3 -# define PYBIND11_INTERNALS_VERSION 6 -# elif PY_VERSION_HEX >= 0x030C0000 || defined(_MSC_VER) -// Version bump for Python 3.12+, before first 3.12 beta release. -// Version bump for MSVC piggy-backed on PR #4779. See comments there. -# ifdef Py_GIL_DISABLED -# define PYBIND11_INTERNALS_VERSION 6 -# else -# define PYBIND11_INTERNALS_VERSION 5 -# endif +# define PYBIND11_INTERNALS_VERSION 106 # else -# define PYBIND11_INTERNALS_VERSION 4 +# define PYBIND11_INTERNALS_VERSION 6 # endif #endif // This requirement is mainly to reduce the support burden (see PR #4570). static_assert(PY_VERSION_HEX < 0x030C0000 || PYBIND11_INTERNALS_VERSION >= 5, "pybind11 ABI version 5 is the minimum for Python 3.12+"); +static_assert(PYBIND11_INTERNALS_VERSION >= 4, + "pybind11 ABI version 4 is the minimum for all platforms."); PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) @@ -244,7 +238,7 @@ struct internals { } }; -#if PYBIND11_INTERNALS_VERSION >= 6 +#if PYBIND11_INTERNALS_VERSION >= 106 # define PYBIND11_HAS_INTERNALS_WITH_SMART_HOLDER_SUPPORT diff --git a/include/pybind11/eigen/matrix.h b/include/pybind11/eigen/matrix.h index 5cf1f0a2a..d2999d61b 100644 --- a/include/pybind11/eigen/matrix.h +++ b/include/pybind11/eigen/matrix.h @@ -316,8 +316,11 @@ struct type_caster::value>> { return false; } + PYBIND11_WARNING_PUSH + PYBIND11_WARNING_DISABLE_GCC("-Wmaybe-uninitialized") // See PR #5516 // Allocate the new type, then build a numpy reference into it value = Type(fits.rows, fits.cols); + PYBIND11_WARNING_POP auto ref = reinterpret_steal(eigen_ref_array(value)); if (dims == 1) { ref = ref.squeeze();