Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: missing field 'tp_version_tag' initializer [-Wmissing-field-initializers] #418

Open
marcosbento opened this issue Jun 20, 2023 · 0 comments

Comments

@marcosbento
Copy link

Hi,

using Clang 14/15/16 (-Wall -Wpedantic -Wextra) with Boost 1.81.0 and Python 3.11, I get the following warning at

In file included from /my/project/Source.hpp:xx:
In file included from /path/to/boost/1.81.0/include/boost/python.hpp:48:
/path/to/boost/1.81.0/include/boost/python/opaque_pointer_converter.hpp:169:1: warning: missing field 'tp_version_tag' initializer [-Wmissing-field-initializers]

Having a closer look, it seems that when defining a PyTypeObject, at .../include/boost/python/opaque_pointer_converter.hpp, the code isn't considering the last few data members:

// from .../include/python3.11/cpython/object.h
...
struct _typeobject {
...
    PyObject *tp_weaklist;
    destructor tp_del;

    /* Type attribute cache version tag. Added in version 2.6 */
    unsigned int tp_version_tag;

    destructor tp_finalize;
    vectorcallfunc tp_vectorcall;
};
...
// from .../include/boost/python/opaque_pointer_converter.hpp
...
template <class Pointee>
PyTypeObject opaque<Pointee>::type_object =
{
    ...
    0,          /* tp_weaklist */
#if PYTHON_API_VERSION >= 1012
    0           /* tp_del */
#endif
};
...
alanking added a commit to alanking/irods_rule_engine_plugin_python that referenced this issue Oct 12, 2023
This warning is raised by a Boost Python header file when newer versions
of Python are used with Boost 1.81. Since there isn't much we can do about
that, we ignore the warning for that header. For more information, see
boostorg/python#418
alanking added a commit to alanking/irods_rule_engine_plugin_python that referenced this issue Oct 12, 2023
This warning is raised by a Boost Python header file when newer versions
of Python are used with Boost 1.81. Since there isn't much we can do about
that, we ignore the warning for that header. For more information, see
boostorg/python#418
alanking added a commit to alanking/irods_rule_engine_plugin_python that referenced this issue Oct 13, 2023
This warning is raised by a Boost Python header file when newer versions
of Python are used with Boost 1.81. Since there isn't much we can do about
that, we ignore the warning for that header. For more information, see
boostorg/python#418
alanking added a commit to irods/irods_rule_engine_plugin_python that referenced this issue Oct 13, 2023
This warning is raised by a Boost Python header file when newer versions
of Python are used with Boost 1.81. Since there isn't much we can do about
that, we ignore the warning for that header. For more information, see
boostorg/python#418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant