pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Michael Paquier <michael.paquier@gmail.com>
To: Christian Ullrich <chris@chrullrich.net>
Cc: Petr Jelinek <petr@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: VS 2015 support in src/tools/msvc
Date: Sat, 23 Apr 2016 16:11:00 -0400
Message-ID: <571BD6D4.9@dunslane.net> (raw)
In-Reply-To: <CAB7nPqRfbNJC9m56zdDV3=ZSfg6VZG6t3aHHiKnS3PFOPrweVQ@mail.gmail.com>
References: <CAB7nPqTTcRGbDxS_RA4CWn1B_KRsvN+FTpct0mTp3v3gRWQ70g@mail.gmail.com>
	<CAB7nPqR4QHFRZ1vjMo9Njy49hDAXOAjO+AEGhuCDzmhQJRagAw@mail.gmail.com>
	<570792ED.2080003@chrullrich.net>
	<5707AC9E.7070309@dunslane.net>
	<CAB7nPqROXyB_=-BbAXGnCdHFYUE4_+qgQAGk1swwnVQSfiab9Q@mail.gmail.com>
	<5707C80F.9050709@chrullrich.net>
	<5707D7DC.2030508@dunslane.net>
	<5707E074.4030102@chrullrich.net>
	<CAB7nPqSYAxCX+p0D0Qpqv6D4uLb2fmGcpUeKRxMyom5cAziuzg@mail.gmail.com>
	<CAB7nPqSOPynjV7ZC9wghkvwTpDPj7U=py7AoczzguTmv1kmh+g@mail.gmail.com>
	<0B77CFCB-0F90-4CAB-8509-7EB391C06D59@chrullrich.net>
	<570A6A14.6040303@dunslane.net>
	<570A9FCE.5040201@chrullrich.net>
	<570ABFA0.4090403@2ndquadrant.com>
	<CAB7nPqRek6M6HKpNXiNHx0J+rzC0XUbuZ5EMGvHSxLuZsebtyg@mail.gmail.com>
	<CAB7nPqRNwNXQ6C_1kODE5kN0WQUqLuWtPdLD4rn5nGmJUiibLw@mail.gmail.com>
	<57192C59.9090903@dunslane.net>
	<AM2PR06MB069012E632FC3C8D1FC8AD6CD46E0@AM2PR06MB0690.eurprd06.prod.outlook.com>
	<CAB7nPqRfbNJC9m56zdDV3=ZSfg6VZG6t3aHHiKnS3PFOPrweVQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>



On 04/22/2016 01:21 AM, Michael Paquier wrote:
>>> 5. It also complains about us casting a pid_t to a HANDLE in
>>> pg_basebackup.c. Not sure what to do about that.
>> The thing that's being cast is not a PID, but a HANDLE to a process. pid_t is a typedef for int (in port/win32.h), therefore is always 32 bits, while HANDLE is actually void*. However, Microsoft guarantees that kernel32 HANDLEs (this includes those to threads and processes) fit into 32 bits on AMD64.
>>
>> Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ee872017(v=vs.85).aspx, third bullet point.
>>
>> So we can simply silence the warning by casting explicitly.
> Yes, when casting things this way I think that a comment would be fine
> in the code. We could do that as separate patches actually.


We are already casting the pid_t to HANDLE and still getting a warning. 
Apparently we need to do something on win64 like

     (HANDLE) ((int64) bgchild)


cheers

andrew



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (134+ messages)  latest in thread

Message-ID: <571BD6D4.9@dunslane.net>
Permalink:  ../571BD6D4.9@dunslane.net/
Also on:    postgresql.org/message-id/571BD6D4.9@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: andrew@dunslane.net, michael.paquier@gmail.com, chris@chrullrich.net, petr@2ndquadrant.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, magnus@hagander.net
  Subject: Re: VS 2015 support in src/tools/msvc
  In-Reply-To: <571BD6D4.9@dunslane.net>
  References: <CAB7nPqTTcRGbDxS_RA4CWn1B_KRsvN+FTpct0mTp3v3gRWQ70g@mail.gmail.com> <570792ED.2080003@chrullrich.net> <5707AC9E.7070309@dunslane.net> <CAB7nPqROXyB_=-BbAXGnCdHFYUE4_+qgQAGk1swwnVQSfiab9Q@mail.gmail.com> <5707C80F.9050709@chrullrich.net> <5707D7DC.2030508@dunslane.net> <5707E074.4030102@chrullrich.net> <CAB7nPqSYAxCX+p0D0Qpqv6D4uLb2fmGcpUeKRxMyom5cAziuzg@mail.gmail.com> <CAB7nPqSOPynjV7ZC9wghkvwTpDPj7U=py7AoczzguTmv1kmh+g@mail.gmail.com> <0B77CFCB-0F90-4CAB-8509-7EB391C06D59@chrullrich.net> <570A6A14.6040303@dunslane.net> <570A9FCE.5040201@chrullrich.net> <570ABFA0.4090403@2ndquadrant.com> <CAB7nPqRek6M6HKpNXiNHx0J+rzC0XUbuZ5EMGvHSxLuZsebtyg@mail.gmail.com> <CAB7nPqRNwNXQ6C_1kODE5kN0WQUqLuWtPdLD4rn5nGmJUiibLw@mail.gmail.com> <57192C59.9090903@dunslane.net> <AM2PR06MB069012E632FC3C8D1FC8AD6CD46E0@AM2PR06MB0690.eurprd06.prod.outlook.com> <CAB7nPqRfbNJC9m56zdDV3=ZSfg6VZG6t3aHHiKnS3PFOPrweVQ@mail.gmail.com> <571BD6D4.9@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox