From d233796f7d444c67fe51b7dd9521d548e650286f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 12 Dec 2017 23:29:28 +0100 Subject: import.c: Fix a GCC warning (#4822) Fix the warning: Python/import.c: warning: comparison between signed and unsigned integer expressions if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) { --- Python/import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/import.c b/Python/import.c index 892f3d1..d5dad1a 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2308,7 +2308,7 @@ PyImport_ExtendInittab(struct _inittab *newtab) _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); /* Allocate new memory for the combined table */ - if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) { + if ((i + n + 1) <= PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(struct _inittab)) { size_t size = sizeof(struct _inittab) * (i + n + 1); p = PyMem_RawRealloc(inittab_copy, size); } -- cgit v0.12