bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib subverts system typedef for intptr_t


From: Bruno Haible
Subject: Re: gnulib subverts system typedef for intptr_t
Date: Mon, 18 Nov 2019 22:52:19 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; )

Hi Keith,

> > I ran into this, when cross-compiling GNU gettext-0.20.1 for a mingw32
> > host; you may find details at
> > 
> >    https://osdn.net/projects/mingw/ticket/39677
> > 
> > While I can work around the compilation failure, (and the workaround
> > likely makes the MinGW.org headers more robust), I thought you may like
> > to know of the underlying issue.

With earlier versions of mingw, the configure test

  checking whether stdint.h conforms to C99...

reports 'yes', then gnulib does not redefined intptr_t, then the declaration
conflict of '_findclose' would not arise.

In other words, the issue you observed is triggered by the fact that the
mingw headers that you are using do not contain a good <stdint.h> any more.
You can find out what is wrong by looking into config.log.

Now, when I put myself into the same situation, by setting the environment
variable

  $ export gl_cv_header_working_stdint_h=no

I encounter two test failures in <stdint.h>.


The first issue is that WINT_MAX is incorrectly defined: it is defined as
  _STDINT_MAX(0, 32, 0)
but ought to be defined as
  _STDINT_MAX(0, 32, 0u)

The second issue is that intptr_t and uintptr_t are 32-bit, whereas pointers
in 64-bit native Windows are 64-bit.

I'm committing the fixes for these two failures (attached).


2019-11-18  Bruno Haible  <address@hidden>

        stdint: Fix value of WINT_MAX when we override wint_t.
        * lib/stdint.in.h (WINT_MIN, WINT_MAX): Don't override a second time
        when GNULIB_OVERRIDES_WINT_T is 1.

2019-11-18  Bruno Haible  <address@hidden>

        stdint: Define [u]intptr_t correctly on 64-bit native Windows.
        * lib/stdint.in.h (gl_intptr_t, gl_uintptr_t, INTPTR_MIN, INTPTR_MAX,
        UINTPTR_MAX): Consider _WIN64.
        * tests/test-stdint.c: Verify that [u]intptr_t is large enough to hold
        a pointer.

Attachment: 0001-stdint-Fix-value-of-WINT_MAX-when-we-override-wint_t.patch
Description: Text Data

Attachment: 0002-stdint-Define-u-intptr_t-correctly-on-64-bit-native-.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]