Re: Re: popen and pclose redefinitions causing many warning in Windows build

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: popen and pclose redefinitions causing many warning in Windows build
Date: 2014-05-28 21:02:23
Message-ID: 20140528210223.GE28490@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 28, 2014 at 12:29:28PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > I think this is caused because the variable is not defined as SOCKET.
> > The attached patch fixes this. This should prevent the warning.
>
> Surely that's just going to move the errors somewhere else. The call
> site still expects the argument to be int[].

Ah, yes, you are right. This is a similar problem I had with libpq
where PQsocket() had to return an int.

Attached is an updated patch which follows my previous coding of
checking for PGINVALID_SOCKET, and if not equal, assigns the value to an
integer handle. I would also like to rename variable 's' to
'listen_sock', but that is not in the patch, for clarity reasons.

Should this be held for 9.5? I think it is only warning removal. On
the other hand, portability is what we do during beta testing.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachment Content-Type Size
socket.diff text/x-diff 3.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-05-28 21:19:33 Re: Extended Prefetching using Asynchronous IO - proposal and patch
Previous Message Andres Freund 2014-05-28 20:55:28 Re: pgsql: Fix bogus %name-prefix option syntax in all our Bison files.