Re: Windows 64 bit warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Windows 64 bit warnings
Date: 2011-04-19 14:41:55
Message-ID: 1626.1303224115@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> If we cast the HANDLE to a long long first and then truncate it the
> compiler is silent, it only complains if that's done in one operation.

> So maybe something like:

> #ifdef WIN64
> #define ULONGPID(x) (unsigned long) (unsigned long long) (x)
> #else
> #define ULONGPID(x) (unsigned long) (x)
> #endif

... with a comment, please. Perhaps

#ifdef WIN64
/* need a series of two casts to convert HANDLE without compiler warning */
#define ULONGPID(x) (unsigned long) (unsigned long long) (x)
#else
#define ULONGPID(x) (unsigned long) (x)
#endif

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-04-19 15:16:05 Build farm coverage for isolation tests
Previous Message David Fetter 2011-04-19 14:41:46 Re: pgbench \for or similar loop