-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New warning: conversion from 'Py_ssize_t' to 'int', possible loss of data
in Modules/_testcapimodule.c
#101656
Comments
I think the fix is to replace the Py_ssize_t variables in the test function to |
@ambv can we do that? Because, for example, cpython/Modules/_testcapimodule.c Lines 3165 to 3170 in f87f6e2
And |
Either way, we need to convert |
OK, that makes sense to me, too. Let's go! |
…ng in `_testcapimodule` (pythonGH-101657). (cherry picked from commit acc2f3b) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This happens because:
Py_ssize_t c_args_len = 0;
PyEval_EvalCodeEx
expectsint
:Looks like this is a side effect of ae62bdd
Possible solution is to use an explicit
(int)
converter.I don't think that we should really worry about an overflow in the test code.
I will send a PR to check if this is a proper fix.
CC @ambv as the original PR reviewer.
Linked PRs
_testcapimodule
#101657The text was updated successfully, but these errors were encountered: