diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e09540b3e8..0dc0a82ceb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -360,9 +360,10 @@ jobs: container_suffix: "-bookworm" - clang: 18 std: 20 + cxx_flags: "-Werror -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls" container_suffix: "-bookworm" - name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64" + name: "🐍 3 • Clang ${{ matrix.clang }} • C++${{ matrix.std }} • x64${{ matrix.cxx_flags && ' • cxx_flags' || '' }}" container: "silkeh/clang:${{ matrix.clang }}${{ matrix.container_suffix }}" steps: @@ -378,6 +379,7 @@ jobs: -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} + -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") - name: Build diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index 5fcaf9b9c1..13f82d0307 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -37,22 +37,14 @@ /// further ABI-incompatible changes may be made before the ABI is officially /// changed to the new version. #ifndef PYBIND11_INTERNALS_VERSION -# if 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 -# else -# define PYBIND11_INTERNALS_VERSION 4 -# endif +# define PYBIND11_INTERNALS_VERSION 6 #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) diff --git a/include/pybind11/eigen/matrix.h b/include/pybind11/eigen/matrix.h index 5cf1f0a2a0..d2999d61be 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();