* lib/regex_internal.c (build_wcs_upper_buffer):
Omit useless cast.
---
 ChangeLog            | 6 ++++++
 lib/regex_internal.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a8061b02a7..f36c2c1791 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-09-06  Paul Eggert  <[email protected]>
+
+       regex: pacify GCC 16 -Wuseless-cast
+       * lib/regex_internal.c (build_wcs_upper_buffer):
+       Omit useless cast.
+
 2026-09-05  Paul Eggert  <[email protected]>
 
        Generalize LLM advice to non-prompt models
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index e5e5be84bd..67deb812f7 100644
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -465,8 +465,8 @@ build_wcs_upper_buffer (re_string_t *pstr)
              pstr->offsets[byte_idx] = src_idx;
            ++src_idx;
 
-           /* And also cast it to wide char.  */
-           pstr->wcs[byte_idx++] = (wchar_t) ch;
+           /* And also convert it to wide char.  */
+           pstr->wcs[byte_idx++] = ch;
            if (__glibc_unlikely (mbclen == (size_t) -1))
              pstr->cur_state = prev_st;
          }
-- 
2.55.0


Reply via email to