◐ Shell
clean mode source ↗

Message 187450 - Python tracker

I've just ran into tp_version_tag, when running the boost python testsuite and wondered what it was... Since upgrading to GCC 4.8, I've started to get a lot more warnings with Python extensions, e.g.:-

boost/python/opaque_pointer_converter.hpp:122:14: warning: missing initializer for member ‘_typeobject::tp_version_tag’ [-Wmissing-field-initializers]

In this instance the testsuite was made to compile with the '-Wextra' flag. The fix was pretty simple; add another zero to the opaque_pointer_convert struct.

I have used the following preprocessor macro to test whether or not to do this. Would this be a good way to test for the addition?

#if PY_VERSION_HEX >= 0x02060000
  0,    /* tp_version_tag */
#endif

Cheers,
Alex