[Python-checkins] bpo-41366: Fix clang warning for sign conversion (GH-21592)

Henry Schreiner webhook-mailer at python.org
Thu Jul 23 04:39:19 EDT 2020


https://github.com/python/cpython/commit/680254a8dc64e3ada00f88a7c42d41eb02108353
commit: 680254a8dc64e3ada00f88a7c42d41eb02108353
branch: master
author: Henry Schreiner <HenrySchreinerIII at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-07-23T17:39:03+09:00
summary:

bpo-41366: Fix clang warning for sign conversion (GH-21592)

files:
M Include/cpython/unicodeobject.h

diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h
index 615b4a971d5f4..300408cb26299 100644
--- a/Include/cpython/unicodeobject.h
+++ b/Include/cpython/unicodeobject.h
@@ -52,7 +52,7 @@
 
 Py_DEPRECATED(3.3) static inline void
 Py_UNICODE_COPY(Py_UNICODE *target, const Py_UNICODE *source, Py_ssize_t length) {
-    memcpy(target, source, length * sizeof(Py_UNICODE));
+    memcpy(target, source, (size_t)(length) * sizeof(Py_UNICODE));
 }
 
 Py_DEPRECATED(3.3) static inline void



More information about the Python-checkins mailing list