This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix more compiler warnings "comparison between signed and unsigned integers"
Type: Stage:
Components: Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: matrixise, neologix, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2014-08-17 17:31 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_more_warnings.patch vstinner, 2014-08-17 17:31 review
fix_warning_unicodeobject.diff matrixise, 2014-10-11 09:43 review
issue22218-2.patch matrixise, 2015-11-22 10:38 review
Messages (9)
msg225453 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-08-17 17:31
The issue #22110 enabled more compiler warnings. Attached patch fixes some of them in the Modules/ subdirectory.
msg225454 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-17 17:34
New changeset 05e8f92b58ff by Victor Stinner in branch 'default':
Issue #22218: Fix "comparison between signed and unsigned integers" warnings in
http://hg.python.org/cpython/rev/05e8f92b58ff
msg225455 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-08-17 17:38
You are very fast.
msg225460 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-17 19:07
New changeset ca5eef14c1ab by Victor Stinner in branch 'default':
Issue #22218: Fix "comparison between signed and unsigned integers" warnings in
http://hg.python.org/cpython/rev/ca5eef14c1ab
msg225461 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-17 19:10
New changeset 2f2c1816d0c7 by Victor Stinner in branch 'default':
Issue #22218: Fix "comparison between signed and unsigned integers" warning in
http://hg.python.org/cpython/rev/2f2c1816d0c7
msg225463 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-08-17 19:23
> You are very fast.

Oh sorry. In fact, I didn't expect a review. I just created an issue to put an issue number in the commit changelog and give a little bit more context to my changes.
msg229071 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2014-10-11 09:43
Hi Victor,

Here is a small patch for the unicodeobject.c file.

I am not sure if it's the correct solution to this problem, but for me, the size parameter should be a unsigned long and not a signed.
msg255092 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2015-11-22 10:38
a patch for 3.6 for the unicodeobject.c file
msg262468 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-03-25 23:42
fix_warning_unicodeobject.diff and issue22218-2.patch don't seem to be needed anymore. The code is now:

    if (PY_SSIZE_T_MAX / (Py_ssize_t)sizeof(wchar_t) < (size + 1))
        return NULL;

I close the issue. More specific issues must be opened if you still want to fix similar issues.
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66414
2016-03-25 23:42:06vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg262468
2015-11-22 10:38:12matrixisesetfiles: + issue22218-2.patch

messages: + msg255092
versions: + Python 3.6, - Python 3.5
2014-10-11 09:43:46matrixisesetfiles: + fix_warning_unicodeobject.diff
nosy: + matrixise
messages: + msg229071

2014-08-17 19:23:21vstinnersetmessages: + msg225463
2014-08-17 19:10:06python-devsetmessages: + msg225461
2014-08-17 19:07:28python-devsetmessages: + msg225460
2014-08-17 17:38:24serhiy.storchakasetmessages: + msg225455
2014-08-17 17:34:43python-devsetnosy: + python-dev
messages: + msg225454
2014-08-17 17:31:28vstinnersetnosy: + neologix, serhiy.storchaka
2014-08-17 17:31:19vstinnercreate