From 8ab0ecf24a765d2407ca95b9ed7b2dd7a4604736 Mon Sep 17 00:00:00 2001 From: Alex Malyshev Date: Wed, 10 Sep 2025 10:43:56 -0400 Subject: [PATCH] Address unused variable warning on GIL-enabled builds This integer variable is only used when the GIL is disabled in the build i.e. for free-threaded builds. Otherwise it will cause the compiler to emit an unused variable warning. --- src/c/realize_c_type.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/c/realize_c_type.c b/src/c/realize_c_type.c index fbfa68ca..74b28782 100644 --- a/src/c/realize_c_type.c +++ b/src/c/realize_c_type.c @@ -29,7 +29,6 @@ static PyObject *build_primitive_type(int num); /* forward */ static int init_global_types_dict(PyObject *ffi_type_dict) { int err; - Py_ssize_t i; PyObject *ct_void, *ct_char, *ct2, *pnull; /* XXX some leaks in case these functions fail, but well, MemoryErrors during importing an extension module are kind @@ -78,7 +77,7 @@ static int init_global_types_dict(PyObject *ffi_type_dict) #ifdef Py_GIL_DISABLED // Ensure that all primitive types are initialised to avoid race conditions // on the first access. - for (i = 0; i < _CFFI__NUM_PRIM; i++) { + for (Py_ssize_t i = 0; i < _CFFI__NUM_PRIM; i++) { ct2 = get_primitive_type(i); if (ct2 == NULL) return -1;