]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-96017: Fix some compiler warnings (GH-96018)
authorChristian Heimes <christian@python.org>
Fri, 19 Aug 2022 06:08:43 +0000 (08:08 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Aug 2022 06:08:43 +0000 (08:08 +0200)
- "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

Objects/typeobject.c
Python/ceval_gil.h

index e8c36cf1539911e8112e0e7b55fdfb6d4ffd3996..e61acd295ac4e4205c257a20a0a58c9193db01b7 100644 (file)
@@ -70,11 +70,13 @@ static inline PyTypeObject * subclass_from_ref(PyObject *ref);
 
 /* helpers for for static builtin types */
 
+#ifndef NDEBUG
 static inline int
 static_builtin_index_is_set(PyTypeObject *self)
 {
     return self->tp_subclasses != NULL;
 }
+#endif
 
 static inline size_t
 static_builtin_index_get(PyTypeObject *self)
index 1b2dc7f8e1dc311c535533d71200b552bfe48e51..4c71edd682bf6205fc912435a56b97c8bb84e7e5 100644 (file)
@@ -133,12 +133,14 @@ static void destroy_gil(struct _gil_runtime_state *gil)
     _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked);
 }
 
+#ifdef HAVE_FORK
 static void recreate_gil(struct _gil_runtime_state *gil)
 {
     _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked);
     /* XXX should we destroy the old OS resources here? */
     create_gil(gil);
 }
+#endif
 
 static void
 drop_gil(struct _ceval_runtime_state *ceval, struct _ceval_state *ceval2,