From 7e7c4b26d4bc395bbec959648c50d11a6d297444 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:10:40 +0100 Subject: [PATCH] fix clangcl warning in tracemalloc.c --- Python/tracemalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Python/tracemalloc.c b/Python/tracemalloc.c index 1ee040dde2262d..69ac0c2ab968d6 100644 --- a/Python/tracemalloc.c +++ b/Python/tracemalloc.c @@ -53,7 +53,8 @@ typedef struct tracemalloc_traceback traceback_t; /* The maximum number of frames is either: - The maximum number of frames we can store in `traceback_t.nframe` - The maximum memory size_t we can allocate */ -static const unsigned long MAX_NFRAME = Py_MIN(UINT16_MAX, ((SIZE_MAX - sizeof(traceback_t)) / sizeof(frame_t) + 1)); +static const unsigned long MAX_NFRAME = (unsigned long)Py_MIN( + UINT16_MAX, ((SIZE_MAX - sizeof(traceback_t)) / sizeof(frame_t) + 1)); #define tracemalloc_empty_traceback _PyRuntime.tracemalloc.empty_traceback