[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dfa.c badly broken when dropped into gawk

From: Paul Eggert
Subject: Re: dfa.c badly broken when dropped into gawk
Date: Tue, 17 Dec 2019 12:55:44 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 12/15/19 10:43 AM, Arnold Robbins wrote:
> To reproduce:
> 1. Checkout the gawk repo
> 2. Copy gnulib/lib/dfa.[ch] into gawk/support/.
> 3. Apply the minimal patch below

I looked into that, and the problem was not in Gnulib; it was that your minimal
patch's dfasyntax didn't clear its destination properly. (Gawk master dfa.c
diverged from Gnulib in having its dfaalloc use xzalloc rather than xmalloc, and
the minimal patch didn't capture that divergence.)

Also, it strikes me that dfacopysyntax should set to->canychar to -1, not to
from->canychar, since the canychar calculated from the old syntax shouldn't
affect the new one.

It seems to be error-prone that we're continuing to maintain a separate copy of
dfa.c for Gawk, so I suggest we unify the two copies. I attempted to do that by
installing the attached patches into Gnulib. You should now be able to use
Gnulib dfa.c as follows:

1. Checkout the gawk repo.
2. Copy gnulib/lib/dfa.[ch] and gnulib/lib/localeinfo.[ch] into gawk/support/.

Then build as usual. This works for me on GNU/Linux.

Attachment: 0001-dfa-port-_GL_ATTRIBUTE_MALLOC-to-Gawk.patch
Description: Text Data

Attachment: 0002-dfa-new-function-dfacopysyntax.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]