mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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")
This commit is contained in:
parent
664c2d1fc0
commit
82e73cb951
2 changed files with 11 additions and 1 deletions
|
@ -28,7 +28,12 @@ typedef struct PyModuleDef_Base {
|
||||||
PyObject* m_copy;
|
PyObject* m_copy;
|
||||||
} PyModuleDef_Base;
|
} 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{
|
typedef struct PyModuleDef{
|
||||||
PyModuleDef_Base m_base;
|
PyModuleDef_Base m_base;
|
||||||
|
|
|
@ -10,6 +10,11 @@ What's New in Python 3.2 Beta 1?
|
||||||
Core and Builtins
|
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
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue