[Python-checkins] bpo-35947: Fix a compiler warning in _ctypes.c's StructUnionType_paramfunc(). (GH-12629)

Serhiy Storchaka webhook-mailer at python.org
Sun Mar 31 12:00:18 EDT 2019


https://github.com/python/cpython/commit/48600c72c1afe1096c2412a135a43f8cdd895195
commit: 48600c72c1afe1096c2412a135a43f8cdd895195
branch: master
author: Zackery Spytz <zspytz at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2019-03-31T19:00:12+03:00
summary:

bpo-35947: Fix a compiler warning in _ctypes.c's StructUnionType_paramfunc(). (GH-12629)

files:
M Modules/_ctypes/_ctypes.c

diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 7479edaf1110..03f8e756092c 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -406,7 +406,7 @@ StructUnionType_paramfunc(CDataObject *self)
     CDataObject *copied_self;
     StgDictObject *stgdict;
 
-    if (self->b_size > sizeof(void*)) {
+    if ((size_t)self->b_size > sizeof(void*)) {
         void *new_ptr = PyMem_Malloc(self->b_size);
         if (new_ptr == NULL)
             return NULL;



More information about the Python-checkins mailing list