[Python-checkins] [3.8] bpo-3832: Fix compiler warnings (GH-16518)

Victor Stinner webhook-mailer at python.org
Tue Oct 1 07:52:04 EDT 2019


https://github.com/python/cpython/commit/bfe1f74e39d0049a829962050e86a6a2d2a2781e
commit: bfe1f74e39d0049a829962050e86a6a2d2a2781e
branch: 3.8
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2019-10-01T13:52:00+02:00
summary:

[3.8] bpo-3832: Fix compiler warnings (GH-16518)

* bpo-38321: Fix _asynciomodule.c compiler warning (GH-16493)

bpo-38248, bpo-38321: Fix warning:

    modules\_asynciomodule.c(2667):
    warning C4102: 'set_exception': unreferenced label

The related goto has been removed by
commit edad4d89e357c92f70c0324b937845d652b20afd.

(cherry picked from commit efe74b6369a8d08f27c69703fcc1686966e51068)

* bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)

bpo-22273, bpo-38321: Fix following warning:

    modules\_ctypes\stgdict.c(704):
    warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data

(cherry picked from commit c9a413ede47171a224c72dd34122005170caaad4)

files:
M Modules/_asynciomodule.c
M Modules/_ctypes/stgdict.c

diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index cea3affe99ec3..8eb480fb77eaa 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -2664,7 +2664,6 @@ task_step_impl(TaskObj *task, PyObject *exc)
         /* Some other exception; pop it and call Task.set_exception() */
         PyErr_Fetch(&et, &ev, &tb);
 
-set_exception:
         assert(et);
         if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject *) et)) {
             PyErr_NormalizeException(&et, &ev, &tb);
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index a27d1341dc3ec..fa664bd57a029 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -701,7 +701,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
                 assert(actual_type_index <= MAX_ELEMENTS);
             }
             else {
-                int length = dict->length;
+                Py_ssize_t length = dict->length;
                 StgDictObject *edict;
 
                 edict = PyType_stgdict(dict->proto);



More information about the Python-checkins mailing list