Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
Date
Msg-id 3977658.1668008266@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses RE: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.  ("Daisuke Higuchi (Fujitsu)" <higuchi.daisuke@fujitsu.com>)
List pgsql-bugs
I wrote:
> Thanks for checking that.  However, as that commit message says,
> we require C99 support in v12 and up, and snprintf is definitely
> required by C99.  So I'm disinclined to revert that.  If VS2013
> can't supply snprintf, it's not meeting our minimum platform
> standards, so we should remove it from the list of supported
> platforms.

> Having said that, Microsoft had had well over a dozen years by
> that point to get off their duffs and build a C99-compliant
> library.

After googling the question, I find that indeed Microsoft couldn't
be bothered to support snprintf until VS2015.  Bozos.  Still,
I suppose it'd be better to not move this portability goalpost
in released branches.  We could do something like

#if defined(_MSC_VER) && _MSC_VER < 1900   /* pre-VS2015 */
#define snprintf(str,size,...) sprintf(str,__VA_ARGS__)
#endif

in snprintf.c below where it #undef's snprintf.  Could you
try that and verify it works for you?

Also, the reason we didn't notice this problem is the lack of any
VS2013 animal in the buildfarm.  While we've dropped support for
that as of HEAD (v16), it seems like somebody had better run such
an animal on the back branches if they want the platform to
keep working.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
Next
From: "Daisuke Higuchi (Fujitsu)"
Date:
Subject: RE: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.