* lib/regex_internal.c (re_node_set_insert): Add a DEBUG_ASSERT.
Needed for gcc 16.1.1
20260515 (Red Hat 16.1.1-2) on x86-64 when
_REGEX_AVOID_UCHAR_H is defined.
2026-05-24 Paul Eggert <eggert@cs.ucla.edu>
+ regex: pacify 16.1.1 -Wanalyzer-out-of-bounds
+ * lib/regex_internal.c (re_node_set_insert): Add a DEBUG_ASSERT.
+ Needed for gcc 16.1.1 20260515 (Red Hat 16.1.1-2) on x86-64 when
+ _REGEX_AVOID_UCHAR_H is defined.
+
regex: new _REGEX_AVOID_UCHAR_H option
This is for GNU Emacs, where the regex code is only auxiliary,
probably not enough to justify the hassle of incorporating
else
{
for (idx = set->nelem; set->elems[idx - 1] > elem; idx--)
- set->elems[idx] = set->elems[idx - 1];
+ {
+ set->elems[idx] = set->elems[idx - 1];
+ /* Although we already guaranteed that idx is at least 2 here,
+ add an assertion to pacify GCC 16.1.1 -Wanalyzer-out-of-bounds
+ when _REGEX_AVOID_UCHAR_H is defined. */
+ DEBUG_ASSERT (1 < idx);
+ }
/* Already in set. Return early. */
if (__glibc_unlikely (set->elems[idx - 1] == elem))
return true;