[Python-checkins] bpo-39571: Fix clang warning on PyTypeObject typedef (GH-18385)

Victor Stinner webhook-mailer at python.org
Thu Feb 6 19:43:38 EST 2020


https://github.com/python/cpython/commit/f95cd199b4bc16775c8c48641bd85416b17742e7
commit: f95cd199b4bc16775c8c48641bd85416b17742e7
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020-02-07T01:43:25+01:00
summary:

bpo-39571: Fix clang warning on PyTypeObject typedef (GH-18385)

Only define PyTypeObject type once.

files:
M Include/cpython/object.h

diff --git a/Include/cpython/object.h b/Include/cpython/object.h
index 0b5260eda7d8a..4600f942ee766 100644
--- a/Include/cpython/object.h
+++ b/Include/cpython/object.h
@@ -190,7 +190,7 @@ typedef struct {
  * backwards-compatibility */
 typedef Py_ssize_t printfunc;
 
-typedef struct _typeobject {
+struct _typeobject {
     PyObject_VAR_HEAD
     const char *tp_name; /* For printing, in format "<module>.<name>" */
     Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */
@@ -271,7 +271,7 @@ typedef struct _typeobject {
 
     destructor tp_finalize;
     vectorcallfunc tp_vectorcall;
-} PyTypeObject;
+};
 
 /* The *real* layout of a type object when allocated on the heap */
 typedef struct _heaptypeobject {



More information about the Python-checkins mailing list