Skip to content

[3.13] Fix a compiler warning in _randommodule.c (GH-141058)#141064

Merged
vstinner merged 1 commit into
python:3.13from
miss-islington:backport-4ac16dd-3.13
Nov 5, 2025
Merged

[3.13] Fix a compiler warning in _randommodule.c (GH-141058)#141064
vstinner merged 1 commit into
python:3.13from
miss-islington:backport-4ac16dd-3.13

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

The test just before the cast ensures that the cast cannot overflow.

Fix the warning on 32-bit Windows:

Modules\_randommodule.c(525,28): warning C4244: '=': conversion
from 'uint64_t' to 'Py_ssize_t', possible loss of data

(cherry picked from commit 4ac16dd)

Co-authored-by: Victor Stinner vstinner@python.org

The test just before the cast ensures that the cast cannot overflow.

Fix the warning on 32-bit Windows:

    Modules\_randommodule.c(525,28): warning C4244: '=': conversion
    from 'uint64_t' to 'Py_ssize_t', possible loss of data
(cherry picked from commit 4ac16dd)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner vstinner enabled auto-merge (squash) November 5, 2025 18:46
@vstinner vstinner merged commit 3ecf637 into python:3.13 Nov 5, 2025
42 checks passed
@miss-islington miss-islington deleted the backport-4ac16dd-3.13 branch January 2, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants