[issue43030] signed/unsigned mismatch in Py_UNICODE_ISSPACE macro
Matthias Klose
report at bugs.python.org
Tue Jan 26 07:40:22 EST 2021
New submission from Matthias Klose <doko at debian.org>:
[forwarded from https://bugs.debian.org/961396]
$ cat > foo.c
#include <Python.h>
int main(int argc, char *argv[])
{
Py_UNICODE x = 0;
return Py_UNICODE_ISSPACE(x);
}
$ gcc -Wsign-compare -Werror $(pkg-config --cflags python3) foo.c
In file included from /usr/include/python3.9/unicodeobject.h:1026,
from /usr/include/python3.9/Python.h:97,
from foo.c:1:
foo.c: In function ‘main’:
/usr/include/python3.9/cpython/unicodeobject.h:25:11: error: comparison of integer expressions of different signedness: ‘Py_UNICODE’ {aka ‘int’} and ‘unsigned int’ [-Werror=sign-compare]
25 | ((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
| ^
foo.c:7:16: note: in expansion of macro ‘Py_UNICODE_ISSPACE’
7 | return Py_UNICODE_ISSPACE(x);
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
----------
components: Extension Modules
messages: 385707
nosy: doko
priority: normal
severity: normal
status: open
title: signed/unsigned mismatch in Py_UNICODE_ISSPACE macro
versions: Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43030>
_______________________________________
More information about the Python-bugs-list
mailing list