From 70dd2006e5022fe12cd13e3ff707c5757ee9be30 Mon Sep 17 00:00:00 2001
From: Christian Heimes <christian@python.org>
Date: Fri, 19 Aug 2022 08:08:43 +0200
Subject: [PATCH] [3.11] 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.
(cherry picked from commit d9c1b746b5013f81d1724757bb3c6a1c87c4a8dc)

Co-authored-by: Christian Heimes <christian@python.org>
---
 Python/ceval_gil.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Python/ceval_gil.h b/Python/ceval_gil.h
index 1b2dc7f8e1dc31..4c71edd682bf62 100644
--- a/Python/ceval_gil.h
+++ b/Python/ceval_gil.h
@@ -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,