Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
zero-initialize all fields, fixing compiler warnings seen when building
extension modules with gcc with "-Wmissing-field-initializers" (implied
by "-W")
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
index 376a525..34fa810 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -28,7 +28,12 @@
   PyObject* m_copy;
 } PyModuleDef_Base;
 
-#define PyModuleDef_HEAD_INIT {PyObject_HEAD_INIT(NULL)}
+#define PyModuleDef_HEAD_INIT { \
+    PyObject_HEAD_INIT(NULL)    \
+    NULL, /* m_init */          \
+    0,    /* m_index */         \
+    NULL, /* m_copy */          \
+  }
 
 typedef struct PyModuleDef{
   PyModuleDef_Base m_base;
diff --git a/Misc/NEWS b/Misc/NEWS
index 4312186..9f47ca3 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,11 @@
 Core and Builtins
 -----------------
 
+- Issue #9518: Extend the PyModuleDef_HEAD_INIT macro to explicitly
+  zero-initialize all fields, fixing compiler warnings seen when building
+  extension modules with gcc with "-Wmissing-field-initializers" (implied
+  by "-W")
+
 Library
 -------