[pcre-dev] [Bug 1830] pcre2posix defines the same names as P…

Page principale
Supprimer ce message
Auteur: admin
Date:  
À: pcre-dev
Sujet: [pcre-dev] [Bug 1830] pcre2posix defines the same names as POSIX
https://bugs.exim.org/show_bug.cgi?id=1830

--- Comment #6 from Philip Hazel <ph10@???> ---
(In reply to Pascal MALAISE from comment #5)
> I don't face the issue if I install PCRE myself (in /usr/local for example).
> Still this "packaging" of the API is important when PCRE is installed as
> part of a distrib, otherwise we compile with pcreposix and (may) link with
> POSIX.
> Would it be possible to make this "trick" part of the official PCRE delivery?


The problem is that it would be an incompatible change. The pcreposix wrapper
was created in October 1997 and the interface has not changed. It means that a
program can be linked with pcreposix without having to be recompiled. Your
"trick" would require recompiling, or somehow modifying the already-compiled
application.

I am very loath to make incompatible changes because, however rare you think
dependence on some feature may be, there is always sure to be somebody who gets
caught out.

> Side question: At present, the workaround I have found is to "embed"
> pcre2posix sources (.h and .c) in my code. When doing this I have been
> surprised to see that pcre2posix source relies on some internal data of
> PCRE2 (pcre2_real_code_8, pcre2_real_match_data). Is it simply a matter of
> optimization? Is there any way to re-implement pcre2posix on top of the
> public API of PCRE2? This would make my workaround less nasty.


Hmm. I thought it was.

$ pcre2grep pcre2_real_code_8 src/pcre2posix.*
$

I'm slightly mystified here because I can't see any reference to
pcre2_real_code_8 in the pcre2posix sources (or "real" at all, in fact).
It does include pcre2_internal.h, which defines some "real" things, but I can't
see where it might use them. I also looked for match_data:

$ pcre2grep pcre2_match_data src/pcre2posix.*
src/pcre2posix.c:pcre2_match_data_free(preg->re_match_data);
src/pcre2posix.c:preg->re_match_data = pcre2_match_data_create(re_nsub + 1,
NULL);
src/pcre2posix.c:pcre2_match_data *md = (pcre2_match_data
*)preg->re_match_data;
$

None of the refences mention "real". However, you now have me wondering why it
#includes pcre2_internal.h. I will investigate further.

--
You are receiving this mail because:
You are on the CC list for the bug.