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/cabueveyezfuvaymunop3nyrvvrh2up2tstk8sxvapderf8p...@mail.gmail.com 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? -- Michael
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 15f43f9432..77a7c148ba 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -1445,7 +1445,9 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
if (file == NULL)
{
+#ifndef WIN32
int filemode;
+#endif
/*
* No current file, so this must be the header for a new file
@@ -1459,8 +1461,10 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
current_len_left = read_tar_number(©buf[124], 12);
+#ifndef WIN32
/* Set permissions on the file */
filemode = read_tar_number(©buf[100], 8);
+#endif
/*
* All files are padded up to 512 bytes
signature.asc
Description: PGP signature
