Closed
Description
An anonymous union was added recently, making this header produce warnings/errors for C++ compilers that have not enabled the relevant extensions/standards.
This code looks like it's making a few too many assumptions anyway. I suspect we ought to be wrapping up accesses to ob_refcnt_split
in a macro and masking, rather than using a union. Or at least setting up the union to not assume that SIZEOF_VOID_P > 4
implies SIZEOF_VOID_P == 8
.
(Ping @eduardo-elizondo)
Linked PRs
- gh-105059: Remove anonymous union from PyObject #105275
- [DRAFT] gh-105059: In C++, Py_INCREF() uses a function call #105764
- [DRAFT] gh-105059: C99 avoids PyObject.ob_refcnt union #105767
- gh-105059: Use GCC/clang extension for PyObject union #107232
- [3.12] gh-105059: Use GCC/clang extension for PyObject union (GH-107232) #107236
- gh-105059: Fix MSCV compiler warning on PyObject union #107239
- [3.12] gh-105059: Fix MSCV compiler warning on PyObject union (GH-107239) #107248
Metadata
Metadata
Assignees
Projects
Status
Done