From ab0ba6e73ae9b3c9956126bdcd3c410238a27244 Mon Sep 17 00:00:00 2001
From: Andrew Dunstan <andrew@dunslane.net>
Date: Thu, 28 Apr 2011 15:05:58 -0400
Subject: [PATCH] Add some casts to try to silence most of the remaining format
 warnings on MinGW-W64.

---
 src/backend/postmaster/postmaster.c | 4 ++--
 src/backend/postmaster/syslogger.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index c0cf0336a1e..1e2aa9f0925 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -3304,7 +3304,7 @@ BackendStartup(Port *port)
 	/* in parent, successful fork */
 	ereport(DEBUG2,
 			(errmsg_internal("forked new backend, pid=%d socket=%d",
-							 (int) pid, port->sock)));
+							 (int) pid, (int) port->sock)));
 
 	/*
 	 * Everything's been successful, it's safe to add this backend to our list
@@ -4809,7 +4809,7 @@ write_inheritable_socket(InheritableSocket *dest, SOCKET src, pid_t childpid)
 		{
 			ereport(LOG,
 					(errmsg("could not duplicate socket %d for use in backend: error code %d",
-							src, WSAGetLastError())));
+							(int) src, WSAGetLastError())));
 			return false;
 		}
 	}
diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c
index a00b70f934e..85e4f808db8 100644
--- a/src/backend/postmaster/syslogger.c
+++ b/src/backend/postmaster/syslogger.c
@@ -634,7 +634,7 @@ syslogger_forkexec(void)
 #else							/* WIN32 */
 	if (syslogFile != NULL)
 		snprintf(filenobuf, sizeof(filenobuf), "%ld",
-				 _get_osfhandle(_fileno(syslogFile)));
+				 (long) _get_osfhandle(_fileno(syslogFile)));
 	else
 		strcpy(filenobuf, "0");
 #endif   /* WIN32 */
-- 
GitLab