Autor: ph10 Fecha: A: Daniel Richard G. Cc: pcre-dev Asunto: Re: [pcre-dev] memmove() vs. bcopy()
On Fri, 10 Aug 2018, Daniel Richard G. wrote:
> This is usually addressed with __attribute__((unused)) for GCC/Clang.
But I don't want to rely on people using GCC/Clang.
> Three copies of the same function... I don't know...
Previously, there was a copy of the function for *every* library module.
In early PCRE1 days there were only one or two. Now there would be
around 30 copies! What I have just done gives each library (8-bit,
16-bit, 32-bit) its own single copy, and pcre2test and pcre2grep also
each have a copy. In each of the latter two programs, there is only one
call to memmove(). In pcre2test, since it "knows" about the libraries, I
could have juggled things to make use of an internal library copy, but
pcre2grep is a clean PCRE2 application, so can't do that. It could be
re-jigged to do the one job inline, but having the function available
means it will all work if memmove() is used somewhere else in pcre2grep
in the future - I certainly expect to have memmove() when I'm coding.