Skip to content

Commit 05f5d41

Browse files
authored
[3.12] gh-106560: Fix redundant declarations in Include/ (#112611) (#112650)
gh-106560: Fix redundant declarations in Include/ (#112611) Don't declare PyBool_Type and PyLong_Type twice, but only once. Compiler warnings seen by building Python with gcc -Wredundant-decls.
1 parent 73cda99 commit 05f5d41

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Include/boolobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern "C" {
77
#endif
88

99

10-
PyAPI_DATA(PyTypeObject) PyBool_Type;
10+
// PyBool_Type is declared by object.h
1111

1212
#define PyBool_Check(x) Py_IS_TYPE((x), &PyBool_Type)
1313

Include/longobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern "C" {
77

88
/* Long (arbitrary precision) integer object interface */
99

10-
PyAPI_DATA(PyTypeObject) PyLong_Type;
10+
// PyLong_Type is declared by object.h
1111

1212
#define PyLong_Check(op) \
1313
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix redundant declarations in the public C API. Declare PyBool_Type and
2+
PyLong_Type only once. Patch by Victor Stinner.

0 commit comments

Comments
 (0)