From 23ee4f275df3605aacaab9c8d2730a0d2fc13475 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 4 Dec 2024 07:21:38 -0700 Subject: [PATCH] utf8_to_uv_msgs: Silence some compiler warnings These showed up running gcc on a 32-bit build --- utf8.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utf8.c b/utf8.c index f1abd238cae3..26e03e7278fa 100644 --- a/utf8.c +++ b/utf8.c @@ -1765,7 +1765,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, * there are other malformations, we may be still be able to tell if this * is an overlong by looking at the UTF-8 byte sequence itself */ if ( ( LIKELY(! possible_problems) - && UNLIKELY(expectlen > OFFUNISKIP(uv))) + && UNLIKELY(expectlen > (SSize_t) OFFUNISKIP(uv))) || ( UNLIKELY(possible_problems) && UTF8_IS_SYNTACTIC_START_BYTE(s0) && UNLIKELY(0 < is_utf8_overlong(s0, s - s0)))) @@ -1841,7 +1841,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, * full length with occurrences of the smallest continuation * byte. For surrogates we could just look at the bytes, but * this single algorithm works for both those and supers. */ - for (unsigned i = curlen; i < expectlen; i++) { + for (int i = curlen; i < expectlen; i++) { uv = UTF8_ACCUMULATE(uv, UTF8_MIN_CONTINUATION_BYTE); } } @@ -2073,7 +2073,8 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, switch (this_problem) { default: Perl_croak(aTHX_ "panic: Unexpected case value in " - " utf8n_to_uvchr_msgs() %d", this_problem); + " utf8n_to_uvchr_msgs() %ld", + (long) this_problem); /* NOTREACHED */ break;