[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uses of xinmalloc and xpmalloc triggered make syntax-check failure
From: |
Jim Meyering |
Subject: |
Re: uses of xinmalloc and xpmalloc triggered make syntax-check failure |
Date: |
Wed, 7 Jun 2023 11:20:34 -0700 |
On Wed, Jun 7, 2023 at 1:38 AM Bruno Haible <bruno@clisp.org> wrote:
> Jim Meyering wrote:
> > regenerate regex to reflect new functions in xalloc.h
>
> How did you do that? By hand, or using some of the techniques from [1] or [2]?
Hi Bruno, the comments just above include the commands I ran to create
the resulting regular expression:
perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1'
lib/xalloc.h \
| sort | perl -MRegexp::Assemble -le \
'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed
's/\?://g'
However, I expect that it will be better to skip the regexp
optimization (that perl module is not always installed) and just use a
simple '|'d list of tokens, because that can all be done at test time
using portable tools.