[Python-checkins] bpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed wchar_t (GH-24350) (GH-24397)

serhiy-storchaka webhook-mailer at python.org
Sun Jan 31 09:46:26 EST 2021


https://github.com/python/cpython/commit/229ef39bcc14ee7838968dfda51d045304e5cf39
commit: 229ef39bcc14ee7838968dfda51d045304e5cf39
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2021-01-31T16:46:17+02:00
summary:

bpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed wchar_t (GH-24350) (GH-24397)

(cherry picked from commit 42b1806af90b86ec393ca7da14e99ce95ec6c53b)

Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

files:
A Misc/NEWS.d/next/C API/2021-01-27-10-27-47.bpo-43030.loDcD_.rst
M Include/cpython/unicodeobject.h

diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h
index 54a13e32ba22b..87ff31ddbc101 100644
--- a/Include/cpython/unicodeobject.h
+++ b/Include/cpython/unicodeobject.h
@@ -22,7 +22,7 @@ extern "C" {
 
  */
 #define Py_UNICODE_ISSPACE(ch) \
-    ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
+    ((Py_UCS4)(ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
 
 #define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch)
 #define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch)
diff --git a/Misc/NEWS.d/next/C API/2021-01-27-10-27-47.bpo-43030.loDcD_.rst b/Misc/NEWS.d/next/C API/2021-01-27-10-27-47.bpo-43030.loDcD_.rst
new file mode 100644
index 0000000000000..7a432522db8a1
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2021-01-27-10-27-47.bpo-43030.loDcD_.rst	
@@ -0,0 +1,2 @@
+Fixed a compiler warning in :c:func:`Py_UNICODE_ISSPACE()` on platforms with
+signed ``wchar_t``.



More information about the Python-checkins mailing list