Re: Compiler warnings with MinGW

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: Compiler warnings with MinGW
Date: 2019-07-19 12:41:28
Message-ID: d14dc6a5-9ed3-13e4-b2b5-65667adbfbd2@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 7/19/19 1:08 AM, Michael Paquier wrote:
> Hi all,
>
> 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]
>
> c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.build/../pgsql/src/bin/pg_basebackup/pg_basebackup.c:1448:8:
> warning: variable 'filemode' set but not used
> [-Wunused-but-set-variable]
> Jul 18 21:59:49 int filemode;
>
> 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.

>
> The second one is rather obvious to fix, because we don't care about
> the file mode on Windows, so the attached should do the work. I am
> actually surprised that the Visual Studio compilers don't complain
> about that, but let's fix it.
>
> Thoughts?

+1.

cheers

andrew

--
Andrew Dunstan https://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 Robert Haas 2019-07-19 13:05:12 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Andrew Dunstan 2019-07-19 12:30:38 Re: Compile from source using latest Microsoft Windows SDK