Re: [pcre-dev] [PATCH] PCRE2 on Windows

Top Page

Reply to this message
Author: Daniel Richard G.
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] [PATCH] PCRE2 on Windows
Hi Philip,

On Wed, 2018 Jun 20 18:13+0100, ph10@??? wrote:
>
> My turn to apologise for delay; other things took longer than intended
> and Life keeps interfering. Anyway, I am at last working through the
> issues discussed in our most recent correspondence. I have just
> committed a patch that deals with these:


Thanks for looking at this Philip; I've reviewed the updates.

> > * In both the Autoconf and CMake configuration, set variables to 0
> > or 1 indicating the presence or absence of both inttypes.h and
> > stdint.h.
>
> For Autoconf I found what I think is a tidier way of doing what
> you did.


Note that Autoconf is not setting the variables to zero when the headers
are not found. On an old FreeBSD system here, for example, the generated
pcre2.h contains

    #define PCRE2_HAVE_STDINT_H   
    #define PCRE2_HAVE_INTTYPES_H 1


The first one will be assumed to be zero in preprocessor expressions,
but not without producing a warning with -Wundef.

> > * Some older C compilers, like MSVC, do not support "%td". I added
> > a check that uses "%lu" for any non-C99 build environment, as a
> > catch-all.
>
> I have added a check on defined(__STDC_VERSION__) to be pedantic.


Good call.

> > * Similarly, older C compilers do not support "%zu". I changed this
> > to "%lu" and a cast, as I presume pcre2test is not likely to ever
> > handle a >4 GB pattern.
>
> You missed a couple of cases (some of which were %zd, don't know why). I
> have dealt with this as for %td, defining macros for the format and for
> the cast. So in modern systems it should continue to use %z.


Ah, so the cast is covered too. Looks good.

> Further work continuing...


I'll get to you an additional patch addressing a couple more CMake
issues, as well as providing a reasonable solution for missing integer
types via Autoconf. I do have an unrelated question which I'll be
sending in separately.


--Daniel


--
Daniel Richard G. || skunk@???
My ASCII-art .sig got a bad case of Times New Roman.