Skip to content

gh-111178: Change Argument Clinic signature for METH_METHOD #131102

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

Closed
wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 11, 2025

Replace "Py_ssize_t nargs" with "size_t nargs" for METH_METHOD|METH_FASTCALL functions to fix an undefined behavior.

Replace "Py_ssize_t nargs" with "size_t nargs" for
METH_METHOD|METH_FASTCALL functions to fix an undefined behavior.
@vstinner
Copy link
Member Author

Oh, there is a new compiler warning:

In file included from ../cpython-ro-srcdir/Modules/_io/clinic/bufferedio.c.h:11,
                 from ../cpython-ro-srcdir/Modules/_io/bufferedio.c:2505:

../cpython-ro-srcdir/Modules/_io/clinic/bufferedio.c.h: In function ‘_io__BufferedIOBase_read’:
Warning: ../cpython-ro-srcdir/Include/internal/pycore_modsupport.h:90:16: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
   90 |       (minpos) <= (nargs) && ((varpos) || (nargs) <= (maxpos)) && (args) != NULL) ? \
      |                ^~

../cpython-ro-srcdir/Modules/_io/clinic/bufferedio.c.h:154:12: note: in expansion of macro ‘_PyArg_UnpackKeywords’
  154 |     args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser,
      |            ^~~~~~~~~~~~~~~~~~~~~

@vstinner
Copy link
Member Author

I abandon this PR in favor of #131135.

@vstinner vstinner closed this Mar 12, 2025
@vstinner vstinner deleted the clinic_size_nargs branch March 12, 2025 11:19
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.

1 participant