diff --git a/Include/slots.h b/Include/slots.h index 4bf7bda0208a8d..3ef8768bbd26c3 100644 --- a/Include/slots.h +++ b/Include/slots.h @@ -42,7 +42,7 @@ struct PySlot { #define PySlot_STATIC_DATA(NAME, VALUE) \ {.sl_id=(NAME), .sl_flags=PySlot_STATIC, .sl_ptr=(VALUE)} -#define PySlot_END {0} +#define PySlot_END {0, 0, {0}, {0}} // Macros without designated initializers (for C++11 and below): diff --git a/Misc/NEWS.d/next/C_API/2026-10-05-17-09-35.gh-issue-149044.1HUiag.rst b/Misc/NEWS.d/next/C_API/2026-10-05-17-09-35.gh-issue-149044.1HUiag.rst new file mode 100644 index 00000000000000..3861d23e27f8b3 --- /dev/null +++ b/Misc/NEWS.d/next/C_API/2026-10-05-17-09-35.gh-issue-149044.1HUiag.rst @@ -0,0 +1,2 @@ +Fix the :c:macro:`PySlot_END` macro for C++: initialize all members to avoid +compiler warnings. Patch by Victor Stinner.