Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
Date: 2018-04-30 18:41:58
Message-ID: 23691.1525113718@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> On 4/30/18 13:56, Tom Lane wrote:
>> So this isn't working on Windows: ...
>> The reason seems to be this kluge in plperl.h:
>>
>> /* stop perl headers from hijacking stdio and other stuff on Windows */
>> #ifdef WIN32
>> #define WIN32IO_IS_STDIO
>> /*
>> * isnan is defined in both the perl and mingw headers. We don't use it,
>> * so this just clears up the compile warning.
>> */
>> #ifdef isnan
>> #undef isnan
>> #endif
>> #endif /* WIN32 */
>>
>> Looks like the half-life of that hack just expired. What shall
>> we do about it?

> I have removed this for now. If it's really just about a compiler
> warning, then we can find a different workaround later.

I was just about to propose exactly that fix. This undef'ing of isnan
traces back to Andrew's 2006 commit ea73a78b0. I think perhaps that's not
necessary with any still-supported version of Perl; I see no evidence on
my machines that any Perl header #defines isnan. There is this bit:

#ifdef UNDER_CE
int isnan(double d);
#endif

which would cause trouble if isnan is a macro, but we can hope that
that doesn't apply to us.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2018-04-30 19:13:05 Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform
Previous Message Peter Eisentraut 2018-04-30 18:36:45 Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform