Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1atLwo-00045u-Dc for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Apr 2016 21:15:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1atLwn-0007J7-V6 for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Apr 2016 21:15:38 +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_2) (envelope-from ) id 1atLwm-0007Ha-0L for pgsql-hackers@postgresql.org; Thu, 21 Apr 2016 21:15:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1atLwi-00052i-DZ for pgsql-hackers@postgresql.org; Thu, 21 Apr 2016 21:15:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u3LLFOaI022095; Thu, 21 Apr 2016 17:15:24 -0400 From: Tom Lane To: Andrew Dunstan cc: Michael Paquier , Petr Jelinek , Christian Ullrich , Robert Haas , Magnus Hagander , PostgreSQL mailing lists Subject: Re: VS 2015 support in src/tools/msvc In-reply-to: <57192C59.9090903@dunslane.net> References: <56FB2BF8.3060303@dunslane.net> <5705768E.4020908@dunslane.net> <5706FB7E.5070703@dunslane.net> <570792ED.2080003@chrullrich.net> <5707AC9E.7070309@dunslane.net> <5707C80F.9050709@chrullrich.net> <5707D7DC.2030508@dunslane.net> <5707E074.4030102@chrullrich.net> <0B77CFCB-0F90-4CAB-8509-7EB391C06D59@chrullrich.net> <570A6A14.6040303@dunslane.net> <570A9FCE.5040201@chrullrich.net> <570ABFA0.4090403@2ndquadrant.com> <57192C5! 9.9090903@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Thu, 21 Apr 2016 15:39:05 -0400" Date: Thu, 21 Apr 2016 17:15:24 -0400 Message-ID: <22094.1461273324@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andrew Dunstan writes: > 5. most importantly, on my Release/X64 build, I am getting a regression > failure on contrib/seg. regression diffs attached. Until that's fixed > this isn't going anywhere. I'll bet a nickel that this means MSVC has broken the ABI rules that allowed old-style (version 0) C functions to limp along without changes. seg_same() and the other comparison functions that are misbehaving are declared at the C level to return "bool". I think what's happening is they are now setting only one byte in the return register, or perhaps only the low-order word, leaving the high-order bits as trash. But fmgr_oldstyle is coded as though V0 functions return "char *", and it's going to be putting that whole pointer value into the result Datum, and if the value isn't entirely zero then DatumGetBool will consider it "true". So this theory predicts a lot of intended "false" results will read as "true", which is what your regression diffs show. IIRC, we had intentionally left contrib/seg using mostly V0 calling convention as a canary to let us know when that broke. It's a bit astonishing that it lasted this long, maybe. But it looks like we're going to have to convert at least the bool-returning functions to V1 if we want it to work on VS 2015. Do the other contrib modules all pass? I can't recall if seg was the only one we'd left like this. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers