[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Dave Malcolm dmalc...@redhat.com added the comment: Forgot to close this one out -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Changes by Dave Malcolm dmalc...@redhat.com: -- stage: patch review - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Stefan Behnel sco...@users.sourceforge.net added the comment: I agree that this is annoying, we get the same thing in Cython's test suite all over the place. Any foreign warning that doesn't get triggered helps in debugging your own code. And this one is easy to avoid. -- nosy: +scoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Antoine Pitrou pit...@free.fr added the comment: This looks ok to me. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Dave Malcolm dmalc...@redhat.com added the comment: Fix committed to py3k as r86499 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: the patch looks OK, but out of curiosity: do you really declare all the fields of a PyTypeObject? This structure is really designed so that newer members are left at the end; most types don't need to initialize them, C standard ensures that they will be zero. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Dave Malcolm dmalc...@redhat.com added the comment: Thanks. The code in question is a wrapper to a security-sensitive library (user-space SELinux code), hence the compilation warnings have been turned up as much as possible. The .c code in question is generated by SWIG, and that does indeed appear to be writing out full initializers for PyTypeObject instances (and the other associated structs). It appears to be just Python 3's PyModuleDef_HEAD_INIT macro that leaves fields uninitialized (hence this patch). The gory details of the SWIG-generated code can be seen at: http://userspace.selinuxproject.org/trac/browser/libselinux/src/selinuxswig_wrap.c (and the .i files in that directory) Although it's not on by default gcc will issue a missing initializer warning when fields aren't initialized when -Wmissing-field-initializers is enabled (in this case, due to the use of -W). This becomes an error with -Werror. Whether or not this is a useful warning isn't clear to me, but it seems to be reasonable to suppress the warning given that as-is, people who use gcc's -W catch-all will run into this on all Python 3 modules, and that the patch is trivial, and that this case gives no warnings when building such code against Python 2.* Hope this makes sense. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base
Changes by Dave Malcolm dmalc...@redhat.com: -- title: PyModuleDef_HEAD_INIT does not explicitly initial all fields of m_base - PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com