Skip to content

Commit dc4f0af

Browse files
authored
declare Py_ssize_t i outside of loop initialization (#10091)
Fixes mypyc/mypyc#800 I believe this is the only instance of a variable declaration inside a for-loop initialization. Removing this may help with consistent compilation across different C compiler configurations. See linked issue for more details.
1 parent 683320c commit dc4f0af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mypyc/lib-rt/getargsfast.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ CPyArg_ParseStackAndKeywordsSimple(PyObject *const *args, Py_ssize_t nargs, PyOb
9696
if (kwnames == NULL && nargs >= parser->min && nargs <= parser->max) {
9797
// Fast path: correct number of positional arguments only
9898
PyObject **p;
99-
for (Py_ssize_t i = 0; i < nargs; i++) {
99+
Py_ssize_t i;
100+
for (i = 0; i < nargs; i++) {
100101
p = va_arg(va, PyObject **);
101102
*p = args[i];
102103
}

0 commit comments

Comments
 (0)