From ef524c6df30c3d830c2334f16d2e800a754742b1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 21 Oct 2026 23:51:12 -0700 Subject: [PATCH] gh-160208: Mark PyObject inner struct as anonymous Add __extension__ on the PyObject inner struct to fix the g++ warning: Include/object.h:131:16: error: ISO C++ prohibits anonymous structs [-Wpedantic] 131 | struct { --- Include/object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/object.h b/Include/object.h index 549b91ebecf4f22..7db96416c438241 100644 --- a/Include/object.h +++ b/Include/object.h @@ -128,7 +128,7 @@ struct _object { _Py_ANONYMOUS union { #if SIZEOF_VOID_P > 4 int64_t ob_refcnt_full; /* This field is needed for efficient initialization with Clang on ARM */ - struct { + _Py_ANONYMOUS struct { # if PY_BIG_ENDIAN uint16_t ob_flags; uint16_t ob_overflow;