Re: Compiler warnings with MinGW

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: Compiler warnings with MinGW
Date: 2019-09-06 22:11:25
Message-ID: 6198e51f-d80a-6690-2b67-fa7876eae802@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-07-19 14:41, Andrew Dunstan wrote:
> On 7/19/19 1:08 AM, Michael Paquier wrote:
>> Just browsing through the logs of the buildfarm, I have noticed that
>> some buildfarm animals complain with warnings (jacana uses MinGW):
>> https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=jacana&dt=2019-07-19%2001%3A45%3A28&stg=make
>>
>> There are two of them:
>> c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.build/../pgsql/src/backend/port/win32/mingwcompat.c:60:1:
>> warning: 'RegisterWaitForSingleObject' redeclared without dllimport
>> attribute: previous dllimport ignored [-Wattributes]
>>
>> The first one has been discussed already some time ago and is a cause
>> of 811be893, but nothing got actually fixed (protagonists in CC):
>> https://www.postgresql.org/message-id/CABUevEyeZfUvaYMuNop3NyRvvRh2Up2tStK8SXVAPDERf8p9eg@mail.gmail.com
>
> To answer Magnus' question in that thread, the Mingw headers on jacana
> declare the function with WINBASEAPI which in turn is defined as
> DECLSPEC_IMPORT, as long as _KERNEL32_ isn't defined, and we don't do
> that (and I don't think anything else does either).
>
> So the fix Peter proposed looks like it should be correct.

I'm not sure exactly what the upstream of mingw is these days, but I
think the original issue that led to 811be893 has long been fixed [0],
and the other stuff in mingwcompat.c is also no longer relevant [1]. I
think mingwcompat.c could be removed altogether. I'm not sure to what
extent we need to support 5+ year old mingw versions.

[0]:
https://sourceforge.net/p/mingw-w64/mingw-w64/ci/9d937a7f4f766f903c9433044f77bfa97a0bc1d8/
[1]:
https://sourceforge.net/p/mingw-w64/mingw-w64/ci/88ab6fbdd0a185702a1fce4db935e303030e082f/

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2019-09-06 22:22:03 Re: amcheck verification for GiST
Previous Message Alvaro Herrera from 2ndQuadrant 2019-09-06 21:35:09 Re: amcheck verification for GiST