summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-09-23 12:07:16 (GMT)
committerGitHub <noreply@github.com>2020-09-23 12:07:16 (GMT)
commitb7d8d8dbfe83040087a63662e0b908f4b5ac24b0 (patch)
treefb7af60eab6f060ae4451b9d7c9d5a7c20e2553f /Python
parent71f2ff4ccf4ff8bdb56cc30d115ca2ddc602b12f (diff)
downloadcpython-b7d8d8dbfe83040087a63662e0b908f4b5ac24b0.zip
cpython-b7d8d8dbfe83040087a63662e0b908f4b5ac24b0.tar.gz
cpython-b7d8d8dbfe83040087a63662e0b908f4b5ac24b0.tar.bz2
bpo-40941: Fix stackdepth compiler warnings (GH-22377)
Explicitly cast a difference of two pointers to int: PyFrameObject.f_stackdepth is an int.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 4bb4b82..6430e79 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1433,9 +1433,9 @@ main_loop:
if (_Py_TracingPossible(ceval2) &&
tstate->c_tracefunc != NULL && !tstate->tracing) {
int err;
- /* see maybe_call_line_trace
+ /* see maybe_call_line_trace()
for expository comments */
- f->f_stackdepth = stack_pointer-f->f_valuestack;
+ f->f_stackdepth = (int)(stack_pointer - f->f_valuestack);
err = maybe_call_line_trace(tstate->c_tracefunc,
tstate->c_traceobj,
@@ -2265,7 +2265,7 @@ main_loop:
assert(f->f_lasti >= (int)sizeof(_Py_CODEUNIT));
f->f_lasti -= sizeof(_Py_CODEUNIT);
f->f_state = FRAME_SUSPENDED;
- f->f_stackdepth = stack_pointer-f->f_valuestack;
+ f->f_stackdepth = (int)(stack_pointer - f->f_valuestack);
goto exiting;
}
@@ -2282,7 +2282,7 @@ main_loop:
retval = w;
}
f->f_state = FRAME_SUSPENDED;
- f->f_stackdepth = stack_pointer-f->f_valuestack;
+ f->f_stackdepth = (int)(stack_pointer - f->f_valuestack);
goto exiting;
}