Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fDDkW-0007rY-I4 for pgsql-committers@arkaria.postgresql.org; Mon, 30 Apr 2018 18:42:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fDDkT-0007uK-CZ for pgsql-committers@arkaria.postgresql.org; Mon, 30 Apr 2018 18:42:05 +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.89) (envelope-from ) id 1fDDkT-0007uB-3j for pgsql-committers@lists.postgresql.org; Mon, 30 Apr 2018 18:42:05 +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.89) (envelope-from ) id 1fDDkQ-0005V4-QX for pgsql-committers@lists.postgresql.org; Mon, 30 Apr 2018 18:42:03 +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 w3UIfw3U023692; Mon, 30 Apr 2018 14:41:58 -0400 From: Tom Lane To: Peter Eisentraut cc: Andrew Dunstan , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform In-reply-to: <59e5787f-314e-6e5d-db5e-bcb6b9dbc25c@2ndquadrant.com> References: <21194.1525110966@sss.pgh.pa.us> <59e5787f-314e-6e5d-db5e-bcb6b9dbc25c@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Mon, 30 Apr 2018 14:36:45 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23690.1525113718.1@sss.pgh.pa.us> Date: Mon, 30 Apr 2018 14:41:58 -0400 Message-ID: <23691.1525113718@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut 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