Skip to content

Commit

Permalink
Suppress -Wmaybe-uninitialized warning
Browse files Browse the repository at this point in the history
Reproducer: #5516 (comment)
  • Loading branch information
rwgk committed Feb 8, 2025
1 parent ba5e922 commit cc9da5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/pybind11/eigen/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,11 @@ struct type_caster<Type, enable_if_t<is_eigen_dense_plain<Type>::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<array>(eigen_ref_array<props>(value));
if (dims == 1) {
ref = ref.squeeze();
Expand Down

0 comments on commit cc9da5a

Please sign in to comment.