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

Startseite
Nachricht löschen
Autor: admin
Datum:  
To: pcre-dev
Betreff: [pcre-dev] [Bug 1830] pcre2posix defines the same names as POSIX
https://bugs.exim.org/show_bug.cgi?id=1830

--- Comment #2 from Pascal MALAISE <malaise@???> ---
In pcreposix.h (8.38) I see:
PCREPOSIX_EXP_DECL int pcreposix_regcomp(regex_t *, const char *, int);
and further on in the same file:
#define regcomp pcreposix_regcomp
This allows calling regcomp(...) but also ensures that as soon as I include
pcreposix.h I will finally call the pcreposix_regcomp of libpcreposix.

In pcre2posix.h (10.21) I see:
PCRE2POSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
As a consequence, despite I include pcre2posix the main is not linked to
libpcre2-posix. (Note, the main also calls pcre2_config, so it includes pcr2).

The main:
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
#include <pcre2posix.h>
...
res = regcomp (&regex, argv[1], 0);

The linking command: gcc -o tpcre2 lib_Linux/tpcre2.o -lpcre2-posix -lpcre2-8

ldd tpcre2
    linux-vdso.so.1 
    libpcre2-8.so.0
    libc.so.6 
    libpthread.so.0 
    /lib64/ld-linux-x86-64.so.2 


Similar code and commands with "old" pcre lead to:
    linux-vdso.so.1
    libpcreposix.so.3
    libpcre.so.3
    libc.so.6
    libpthread.so.0
    /lib64/ld-linux-x86-64.so.2


Maybe the pcreposix_regcomp() and #define regcomp pcreposix_regcomp is an
artifact introduced by the debian packager? I use Ubuntu 16.04.
(In reply to Philip Hazel from comment #1)

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