Re: VS 2015 support in src/tools/msvc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, Christian Ullrich <chris(at)chrullrich(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VS 2015 support in src/tools/msvc
Date: 2016-04-21 21:15:24
Message-ID: 22094.1461273324@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:
> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2016-04-21 22:01:23 Incomplete description for \t in psql documentation - should mention caption
Previous Message Kevin Grittner 2016-04-21 21:13:24 Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <