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: Python/hamt.c warnings
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2018-01-29 12:31 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5430 merged yselivanov, 2018-01-29 17:57
Messages (4)
msg311112 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-01-29 12:31
https://ci.appveyor.com/project/python/cpython/build/3.7build11469

..\Python\hamt.c(623): warning C4018: '<': signed/unsigned mismatch [C:\projects\cpython\PCbuild\pythoncore.vcxproj]
..\Python\hamt.c(937): warning C4018: '<': signed/unsigned mismatch [C:\projects\cpython\PCbuild\pythoncore.vcxproj]

IMHO it's a real bug, the warning must not be made quiet. HAMT doesn't support sizes larger than UINT32_MAX. HAMT must either fail to create if size is larger than UINT32_MAX, or the code should be fixed to use wider C types (larger than uint32_t, like uint64_t).
msg311153 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-29 18:00
> IMHO it's a real bug,

No. HAMT bitmap and array nodes can only store up to 32 pointers, so we use Py_ssize_t & Py_SIZE only because those nodes are PyObject_VAR_HEAD objects.
msg311155 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-29 18:31
New changeset b647d7039d396b1da71ab33b101a78b53d4e6834 by Yury Selivanov in branch 'master':
bpo-32707: Fix warnings in hamt.c (#5430)
https://github.com/python/cpython/commit/b647d7039d396b1da71ab33b101a78b53d4e6834
msg311156 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-29 18:32
Hopefully the warnings will be fixed.
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 76888
2018-01-29 18:32:16yselivanovsetcomponents: - asyncio
2018-01-29 18:32:06yselivanovsetstatus: open -> closed
resolution: fixed
messages: + msg311156

stage: resolved
2018-01-29 18:31:45yselivanovsetmessages: + msg311155
2018-01-29 18:00:25yselivanovsetmessages: + msg311153
stage: patch review -> (no value)
2018-01-29 17:57:09yselivanovsetkeywords: + patch
stage: patch review
pull_requests: + pull_request5265
2018-01-29 12:31:06vstinnercreate