Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4EGI-0003jx-P6 for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Dec 2015 20:44:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4EGI-0003LQ-Bx for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Dec 2015 20:44:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4A1q-0007cS-3Y for pgsql-bugs@postgresql.org; Wed, 02 Dec 2015 16:13:14 +0000 Received: from mail-by2on0106.outbound.protection.outlook.com ([207.46.100.106] helo=na01-by2-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4A1m-0004QN-H3 for pgsql-bugs@postgresql.org; Wed, 02 Dec 2015 16:13:12 +0000 Received: from BN4PR07MB2131.namprd07.prod.outlook.com (10.164.63.13) by BN4PR07MB2132.namprd07.prod.outlook.com (10.164.63.14) with Microsoft SMTP Server (TLS) id 15.1.337.19; Wed, 2 Dec 2015 16:13:07 +0000 Received: from BN4PR07MB2131.namprd07.prod.outlook.com ([10.164.63.13]) by BN4PR07MB2131.namprd07.prod.outlook.com ([10.164.63.13]) with mapi id 15.01.0337.015; Wed, 2 Dec 2015 16:13:07 +0000 From: Paul Moore To: Tom Lane CC: "pgsql-bugs@postgresql.org" , Andres Freund Subject: Re: BUG #13788: compile error in generic_msvc.h Thread-Topic: [BUGS] BUG #13788: compile error in generic_msvc.h Thread-Index: AQHRLIAltiebcvI3sUiVqDHu7uXHt5633OmQ Date: Wed, 2 Dec 2015 16:13:07 +0000 Message-ID: References: <20151201165457.2760.18019@wrigleys.postgresql.org> <5176.1449005701@sss.pgh.pa.us> In-Reply-To: <5176.1449005701@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=paul.moore@centrify.com; x-originating-ip: [67.129.77.74] x-microsoft-exchange-diagnostics: 1; BN4PR07MB2132; 5:FOJqZJXJmqno6RtuBlyTFnud2TE/miCF0xpLlVVlAyOsuPDH6NiDTDRuvs3fwF2NBWjdsByC8tdktAY4vkzJIPUSUpfj0Zc/wFSjQULm/G6aifxGJ7Cn0Ztw5fv52Sl052DOJxQZ0RihrdJGRa6t1g==; 24:SBA7iKCYaemHKpoj4OcLu+NlxNZD11yLMH8RfOcoyU1QTYUELGJQPU2YHEs7KmrgT6ZeYXPjHUDWuXOIdVyYUoiw6yWg90mXJv4U2hZNHbY= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN4PR07MB2132; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(11449092643441); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046); SRVR:BN4PR07MB2132; BCL:0; PCL:0; RULEID:; SRVR:BN4PR07MB2132; x-forefront-prvs: 077884B8B5 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(377454003)(189002)(51444003)(50944005)(13464003)(66066001)(92566002)(97736004)(50986999)(101416001)(6116002)(5001960100002)(87936001)(5003600100002)(3846002)(76576001)(5002640100001)(5008740100001)(102836003)(189998001)(110136002)(1220700001)(81156007)(1096002)(586003)(76176999)(33656002)(54356999)(99286002)(19580395003)(2900100001)(77096005)(19580405001)(2950100001)(105586002)(10400500002)(40100003)(86362001)(106116001)(122556002)(106356001)(11100500001)(5004730100002)(74316001)(41533002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN4PR07MB2132; H:BN4PR07MB2131.namprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: centrify.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Centrify.com X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2015 16:13:07.8265 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6779946b-df5b-4a75-80c8-3c610641ec52 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2132 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The 32 bit functions are defined on unsigned types =46rom winbase.h FORCEINLINE unsigned InterlockedCompareExchange( _Inout_ _Interlocked_operand_ unsigned volatile *Destination, _In_ unsigned Exchange, _In_ unsigned Comperand ) { return (unsigned) _InterlockedCompareExchange((volatile long*) Destinat= ion, (long) Exchange, (long) Comperand); } The cast fixes the 64 bit case. Full disclosure, I am compiling as c++. I think that might be the cause. I = tried in a c project and did not get the same error -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 Sent: Tuesday, December 1, 2015 1:35 PM To: Paul Moore Cc: pgsql-bugs@postgresql.org; Andres Freund Subject: Re: [BUGS] BUG #13788: compile error in generic_msvc.h paul.moore@centrify.com writes: > Bug reference: 13788 > Logged by: paul moore > Email address: paul.moore@centrify.com > PostgreSQL version: 9.5beta1 > Operating system: win server 2012 > Description:=20=20=20=20=20=20=20=20 > vs 2015, compiling spi execq sample > vc complains about this > 1>c:\Program > Files\PostgreSQL\9.5\include\server\port/atomics/generic-msvc.h(91):=20 > error > C2664: 'LONG64 _InterlockedCompareExchange64(volatile LONG64 > *,LONG64,LONG64)': cannot convert argument 1 from 'volatile uint64 *'=20 > to 'volatile LONG64 *' > same for the add64 function a few lines later That's a bit weird. A perhaps plausible explanation would be that the comp= iler is unhappy about passing an unsigned argument to a signed parameter; b= ut if they've tightened it up like that, why no similar complaint for the 3= 2-bit versions just above these? Can you try inserting a cast to (volatile int64 *), just to see? regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs