From b90dd106bbc69186fae1962d15d5b0f6bfe13833 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Sun, 22 Feb 2026 08:52:44 +0100 Subject: [PATCH 1/3] warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data --- Modules/unicodedata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index f20726a937ce38..27bdd19c409471 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -1493,7 +1493,7 @@ _getcode(const char* name, int namelen, Py_UCS4* code) } if (i < (int)Py_ARRAY_LENGTH(derived_name_prefixes)) { - Py_UCS4 v = parse_hex_code(name + prefixlen, namelen - prefixlen); + Py_UCS4 v = parse_hex_code(name + prefixlen, namelen - (int)prefixlen); if (find_prefix_id(v) != i) { return 0; } From d7abe805988cde3e1428303056239b92f8cac909 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Sun, 22 Feb 2026 08:54:27 +0100 Subject: [PATCH 2/3] unused warnings in ft jit builds --- Python/optimizer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/optimizer.c b/Python/optimizer.c index f075e28d71e0f8..6a575c8573724a 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -40,6 +40,7 @@ #define _PyExecutorObject_CAST(op) ((_PyExecutorObject *)(op)) +#ifndef Py_GIL_DISABLED static bool has_space_for_executor(PyCodeObject *code, _Py_CODEUNIT *instr) { @@ -110,6 +111,7 @@ insert_executor(PyCodeObject *code, _Py_CODEUNIT *instr, int index, _PyExecutorO instr->op.code = ENTER_EXECUTOR; instr->op.arg = index; } +#endif // Py_GIL_DISABLED static _PyExecutorObject * make_executor_from_uops(_PyThreadStateImpl *tstate, _PyUOpInstruction *buffer, int length, const _PyBloomFilter *dependencies); @@ -128,7 +130,6 @@ _PyOptimizer_Optimize( _PyInterpreterFrame *frame, PyThreadState *tstate) { _PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate; - int chain_depth = _tstate->jit_tracer_state->initial_state.chain_depth; PyInterpreterState *interp = _PyInterpreterState_GET(); if (!interp->jit) { // gh-140936: It is possible that interp->jit will become false during @@ -152,6 +153,7 @@ _PyOptimizer_Optimize( // make progress in order to avoid infinite loops or excessively-long // side-exit chains. We can only insert the executor into the bytecode if // this is true, since a deopt won't infinitely re-enter the executor: + int chain_depth = _tstate->jit_tracer_state->initial_state.chain_depth; chain_depth %= MAX_CHAIN_DEPTH; bool progress_needed = chain_depth == 0; PyCodeObject *code = (PyCodeObject *)_tstate->jit_tracer_state->initial_state.code; From 3a93dad53f528d5527dfb716b5c5d27fe218ccbb Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Sun, 22 Feb 2026 08:57:13 +0100 Subject: [PATCH 3/3] warnings in jit builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * conversion from 'uint64_t' to 'int' * unused variable ‘ip’ --- Python/optimizer_bytecodes.c | 12 ++++++++---- Python/optimizer_cases.c.h | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 228bd51a28bb69..4e4aec2f37e29b 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -1641,7 +1641,8 @@ dummy_func(void) { } op(_GUARD_IP__PUSH_FRAME, (ip/4 --)) { - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + (void)ip; + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); // TO DO // Normal function calls to known functions // do not need an IP guard. @@ -1659,24 +1660,27 @@ dummy_func(void) { } op(_GUARD_IP_YIELD_VALUE, (ip/4 --)) { + (void)ip; if (ctx->frame->caller) { REPLACE_OP(this_instr, _NOP, 0, 0); } - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); } op(_GUARD_IP_RETURN_VALUE, (ip/4 --)) { + (void)ip; if (ctx->frame->caller) { REPLACE_OP(this_instr, _NOP, 0, 0); } - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); } op(_GUARD_IP_RETURN_GENERATOR, (ip/4 --)) { + (void)ip; if (ctx->frame->caller) { REPLACE_OP(this_instr, _NOP, 0, 0); } - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); } diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index a93e85329297cd..286fe014b65f0e 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -4159,34 +4159,38 @@ case _GUARD_IP__PUSH_FRAME: { PyObject *ip = (PyObject *)this_instr->operand0; - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + (void)ip; + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); break; } case _GUARD_IP_YIELD_VALUE: { PyObject *ip = (PyObject *)this_instr->operand0; + (void)ip; if (ctx->frame->caller) { REPLACE_OP(this_instr, _NOP, 0, 0); } - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); break; } case _GUARD_IP_RETURN_VALUE: { PyObject *ip = (PyObject *)this_instr->operand0; + (void)ip; if (ctx->frame->caller) { REPLACE_OP(this_instr, _NOP, 0, 0); } - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); break; } case _GUARD_IP_RETURN_GENERATOR: { PyObject *ip = (PyObject *)this_instr->operand0; + (void)ip; if (ctx->frame->caller) { REPLACE_OP(this_instr, _NOP, 0, 0); } - stack_pointer = sym_set_stack_depth(this_instr->operand1, stack_pointer); + stack_pointer = sym_set_stack_depth((int)this_instr->operand1, stack_pointer); break; }