Skip to content

Commit

Permalink
Fix missing field initializer in (Python 3.12)
Browse files Browse the repository at this point in the history
In Python 3.12, a new internal-only field was added to PyTypeObject,
which must be initialized in ClassDefinition. Both GCC and Clang
complained with:

  warning: missing initializer for member '_typeobject::tp_watched' [-Wmissing-field-initializers]
  • Loading branch information
bdegreve committed May 12, 2024
1 parent eacce47 commit f026cab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lass/python/class_definition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ ClassDefinition::ClassDefinition(
0, /*tp_vectorcall, exists in 3.8 but only used since 3.9 */
#if PY_VERSION_HEX >= 0x03080000 && PY_VERSION_HEX < 0x03090000 // == 3.8
0, /*tp_print, only exists in 3.8 for backwards compatibility, bpo-37250 */
#endif
#if PY_VERSION_HEX >= 0x030C0000 // >= 3.12
0, /*tp_watched, internal only */
#endif
};
type_ = type;
Expand Down

0 comments on commit f026cab

Please sign in to comment.