From eed6b229130aeb7b960b01d20e8f9034875dd599 Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Tue, 23 Sep 2025 21:34:48 +0200 Subject: [PATCH] regexec: do index arithmetic/comparison in unsigned mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise gcc warns when building: In file included from perl.h:4229, from regexec.c:76: regexec.c: In function ‘S_isWB’: regexec.c:6276:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] 6276 | assert(index+1 < C_ARRAY_LENGTH(WB_dfa_table)); | ^ Fixes #23760. --- regexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regexec.c b/regexec.c index 10edc3edb9a6..cbb22eace0a1 100644 --- a/regexec.c +++ b/regexec.c @@ -6273,8 +6273,8 @@ S_isWB(pTHX_ WB_enum previous, /* Here 'matched' is true if the DFA matched the input. If so, * [index+1] contains the value to return */ if (matched) { - assert(index+1 < C_ARRAY_LENGTH(WB_dfa_table)); - return WB_dfa_table[index+1]; + assert(index+1u < C_ARRAY_LENGTH(WB_dfa_table)); + return WB_dfa_table[index+1u]; } /* Here, it didn't match. In [index+2] is stored the index into the