summaryrefslogtreecommitdiffstats
path: root/Include/moduleobject.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2010-11-17 21:20:18 (GMT)
committerDavid Malcolm <dmalcolm@redhat.com>2010-11-17 21:20:18 (GMT)
commit82e73cb951b72d91b924452ee44eefb6f135640f (patch)
treef62b9865bafad360715fac61e63ec710a8f6755f /Include/moduleobject.h
parent664c2d1fc072d0cbd9b92a1cd5c9ac9ad7db326e (diff)
downloadcpython-82e73cb951b72d91b924452ee44eefb6f135640f.zip
cpython-82e73cb951b72d91b924452ee44eefb6f135640f.tar.gz
cpython-82e73cb951b72d91b924452ee44eefb6f135640f.tar.bz2
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")
Diffstat (limited to 'Include/moduleobject.h')
-rw-r--r--Include/moduleobject.h7
1 files changed, 6 insertions, 1 deletions
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 @@ typedef struct PyModuleDef_Base {
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;