Re: [pcre-dev] Dependency issue

Top Page
Delete this message
Author: ph10
Date:  
To: Ze'ev Atlas
CC: Pcre Exim
Subject: Re: [pcre-dev] Dependency issue
On Tue, 14 Jul 2015, Ze'ev Atlas wrote:

> I looked at the code and in pcre2_compile.c, you have this code...PCRE2_SPTRPRIV(find_bracket)(PCRE2_SPTR code, BOOL utf, int number){...
> and there is extern PCRE2_SPTR   _pcre2_find_bracket(PCRE2_SPTR, BOOL, int);
> pcre2_internal.h
> Obviously, in pcre2_compile.c you have legitimate code like...groupptr = PRIV(find_bracket)(codestart, utf, recno);
> ...
> But pcre_compile.c also has this code...if ((re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 &&    PRIV(study)(re) != 0)  {...
>
> The only other module that mentions find_bracket is pcre2_study.c that has similar code like...ce = cs = (PCRE2_UCHAR *)PRIV(find_bracket)(startcode, utf, GET2(slot, 0));
> ...
> This means some form of circular dependency.
> I am not an expert in auto-tools or make or cmake and they may have ways to handle such a situation.  I cannot have that resolved unless I do some dirty tricks and even such tricks won't really work.


I am not an expert in those tools either. However, I don't think there's
any kind of dependency processing. I think both of them just specify
that pcre2_compile.c and pcre2_study.c should both be compiled and
linked together. They just contain a bunch of functions that it happens
to be convenient to split up into two source files for easier
maintanence. Which functions call which probably doesn't matter.

You could try just concatenating the two files and compiling them as a
single unit. Then all the mutually-calling functions would be together.

Philip

--
Philip Hazel