Bruno Haible via Gnulib discussion list <[email protected]> writes:

> Paul Eggert wrote:
>> In the regex code, use the char32_t functions instead of the
>> wchar_t functions
>
> Very nice! This finally implements support for all of Unicode
> in GNU grep for Cygwin.

+1, this is a great change. Thanks!

> I had planned to do this change, but — since I'm not familiar with the
> regex code — I wanted to have a good test coverage in regex-tests first;
> and that project is only 10% done.

Yep. While looking at the regex code for glibc I had the feeling like it
would be great to clean things up a bit. E.g., it has many overflow
checks like this:

    /* Avoid overflow.  */
    if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
                          <= match_last))
      return REG_ESPACE;

    sifted_states = re_malloc (re_dfastate_t *, match_last + 1);

Since the code predates reallocarray. Many variables could also have
their scope restricted, which I know you will agree with.

Maybe some small janitorial work would make it easier to implement the
POSIX.1-2024 features, but perhaps I am being too optimistic.

Collin

Reply via email to