Skip to content

Commit d9c1b74

Browse files
authored
gh-96017: Fix some compiler warnings (GH-96018)
- "comparison of integers of different signs" in typeobject.c - only define static_builtin_index_is_set in DEBUG builds - only define recreate_gil with ifdef HAVE_FORK
1 parent 6740680 commit d9c1b74

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Objects/typeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ static inline PyTypeObject * subclass_from_ref(PyObject *ref);
7070

7171
/* helpers for for static builtin types */
7272

73+
#ifndef NDEBUG
7374
static inline int
7475
static_builtin_index_is_set(PyTypeObject *self)
7576
{
7677
return self->tp_subclasses != NULL;
7778
}
79+
#endif
7880

7981
static inline size_t
8082
static_builtin_index_get(PyTypeObject *self)

Python/ceval_gil.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,14 @@ static void destroy_gil(struct _gil_runtime_state *gil)
133133
_Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked);
134134
}
135135

136+
#ifdef HAVE_FORK
136137
static void recreate_gil(struct _gil_runtime_state *gil)
137138
{
138139
_Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked);
139140
/* XXX should we destroy the old OS resources here? */
140141
create_gil(gil);
141142
}
143+
#endif
142144

143145
static void
144146
drop_gil(struct _ceval_runtime_state *ceval, struct _ceval_state *ceval2,

0 commit comments

Comments
 (0)