bpo-30465: Fix C downcast warning on Windows in ast.c (#6593) · python/cpython@fb7e799 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit fb7e799

vstinnerambv

authored and

committed

bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)

ast.c: fstring_fix_node_location() downcasts a pointer difference to a C int. Replace int with Py_ssize_t to fix the compiler warning.

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 1 addition & 1 deletion

Original file line number Diff line number Diff line change
@@ -4313,7 +4313,7 @@ fstring_fix_node_location(const node *parent, node *n, char *expr_str)
4313 4313 break;
4314 4314 start--;
4315 4315 }
4316 -cols += substr - start;
4316 +cols += (int)(substr - start);
4317 4317 /* Fix lineno in mulitline strings. */
4318 4318 while ((substr = strchr(substr + 1, '\n')))
4319 4319 lines--;