_isnan() on Windows
isnan() function is evidently not present on <math.h> on Windows
before Visual Studio 2013. We define it on win32_port.h using
_isnan(). However _isnan() is also not present. It is on <float.h>.
The patch is attached to include this from win32_port.h.
Thanks to Thomas Munro for point this out to me [1]/messages/by-id/CAEepm=3dE0w=_dOcELpPum6suze2NZwc=AV4T_xYrDUoHbZJvA@mail.gmail.com. It is hard to
notice this issue without testing the changes on Windows.
[1]: /messages/by-id/CAEepm=3dE0w=_dOcELpPum6suze2NZwc=AV4T_xYrDUoHbZJvA@mail.gmail.com
Attachments:
win32_port_float_h_v00.patchapplication/octet-stream; name=win32_port_float_h_v00.patchDownload
commit dfdda6d97f72cc34c1bef9b690652941eaa08a7f
Author: Emre Hasegeli <emre@hasegeli.com>
AuthorDate: 2018-07-10 17:26:59 +0200
Commit: Emre Hasegeli <emre@hasegeli.com>
CommitDate: 2018-07-10 19:28:17 +0200
Include <float.h> from win32_port.h
diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c
index 97e6dc9910..0536b318cc 100644
--- a/src/backend/access/gist/gistproc.c
+++ b/src/backend/access/gist/gistproc.c
@@ -10,21 +10,20 @@
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/backend/access/gist/gistproc.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#include <float.h>
#include <math.h>
#include "access/gist.h"
#include "access/stratnum.h"
#include "utils/builtins.h"
#include "utils/geo_decls.h"
static bool gist_box_leaf_consistent(BOX *key, BOX *query,
StrategyNumber strategy);
diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
index 55cccd247a..12804c321c 100644
--- a/src/backend/access/gist/gistutil.c
+++ b/src/backend/access/gist/gistutil.c
@@ -6,21 +6,20 @@
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/backend/access/gist/gistutil.c
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#include <float.h>
#include <math.h>
#include "access/gist_private.h"
#include "access/htup_details.h"
#include "access/reloptions.h"
#include "catalog/pg_opclass.h"
#include "storage/indexfsm.h"
#include "storage/lmgr.h"
#include "utils/builtins.h"
#include "utils/syscache.h"
diff --git a/src/backend/access/tablesample/bernoulli.c b/src/backend/access/tablesample/bernoulli.c
index 1f2a933935..fba62e7b16 100644
--- a/src/backend/access/tablesample/bernoulli.c
+++ b/src/backend/access/tablesample/bernoulli.c
@@ -17,23 +17,20 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/backend/access/tablesample/bernoulli.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#ifdef _MSC_VER
-#include <float.h> /* for _isnan */
-#endif
#include <math.h>
#include "access/hash.h"
#include "access/tsmapi.h"
#include "catalog/pg_type.h"
#include "optimizer/clauses.h"
#include "optimizer/cost.h"
#include "utils/builtins.h"
diff --git a/src/backend/access/tablesample/system.c b/src/backend/access/tablesample/system.c
index f888e04f40..4d937b4258 100644
--- a/src/backend/access/tablesample/system.c
+++ b/src/backend/access/tablesample/system.c
@@ -17,23 +17,20 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/backend/access/tablesample/system.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#ifdef _MSC_VER
-#include <float.h> /* for _isnan */
-#endif
#include <math.h>
#include "access/hash.h"
#include "access/relscan.h"
#include "access/tsmapi.h"
#include "catalog/pg_type.h"
#include "optimizer/clauses.h"
#include "optimizer/cost.h"
#include "utils/builtins.h"
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index a2a7e0c520..a6811e0338 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -64,23 +64,20 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/backend/optimizer/path/costsize.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#ifdef _MSC_VER
-#include <float.h> /* for _isnan */
-#endif
#include <math.h>
#include "access/amapi.h"
#include "access/htup_details.h"
#include "access/tsmapi.h"
#include "executor/executor.h"
#include "executor/nodeHash.h"
#include "miscadmin.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/clauses.h"
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c
index 0cbdbe5587..0c6c9da253 100644
--- a/src/backend/utils/adt/arrayfuncs.c
+++ b/src/backend/utils/adt/arrayfuncs.c
@@ -8,23 +8,20 @@
*
*
* IDENTIFICATION
* src/backend/utils/adt/arrayfuncs.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <ctype.h>
-#ifdef _MSC_VER
-#include <float.h> /* for _isnan */
-#endif
#include <math.h>
#include "access/hash.h"
#include "access/htup_details.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "libpq/pqformat.h"
#include "utils/array.h"
#include "utils/arrayaccess.h"
#include "utils/builtins.h"
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 979f6fd7b2..017cc1a7b1 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -8,21 +8,20 @@
*
*
* IDENTIFICATION
* src/backend/utils/adt/datetime.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <ctype.h>
-#include <float.h>
#include <limits.h>
#include <math.h>
#include "access/htup_details.h"
#include "access/xact.h"
#include "catalog/pg_type.h"
#include "common/string.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "nodes/nodeFuncs.h"
diff --git a/src/backend/utils/adt/orderedsetaggs.c b/src/backend/utils/adt/orderedsetaggs.c
index 5867f3df07..be9422dcfb 100644
--- a/src/backend/utils/adt/orderedsetaggs.c
+++ b/src/backend/utils/adt/orderedsetaggs.c
@@ -7,21 +7,20 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* src/backend/utils/adt/orderedsetaggs.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#include <float.h>
#include <math.h>
#include "catalog/pg_aggregate.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#include "executor/executor.h"
#include "miscadmin.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/tlist.h"
#include "utils/array.h"
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 4b08cdb721..f1c78ffb65 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -91,21 +91,20 @@
* collation. Thus, in most cases where we are looking at statistics, we
* should ignore the actual operator collation and use DEFAULT_COLLATION_OID.
* We expect that the error induced by doing this is usually not large enough
* to justify complicating matters.
*----------
*/
#include "postgres.h"
#include <ctype.h>
-#include <float.h>
#include <math.h>
#include "access/brin.h"
#include "access/gin.h"
#include "access/htup_details.h"
#include "access/sysattr.h"
#include "catalog/index.h"
#include "catalog/pg_am.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_operator.h"
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 1d75caebe1..b98036f200 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -10,21 +10,20 @@
* IDENTIFICATION
* src/backend/utils/adt/timestamp.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <ctype.h>
#include <math.h>
-#include <float.h>
#include <limits.h>
#include <sys/time.h>
#include "access/hash.h"
#include "access/xact.h"
#include "catalog/pg_type.h"
#include "common/int128.h"
#include "funcapi.h"
#include "libpq/pqformat.h"
#include "miscadmin.h"
diff --git a/src/backend/utils/misc/help_config.c b/src/backend/utils/misc/help_config.c
index 25f5c82804..871c535756 100644
--- a/src/backend/utils/misc/help_config.c
+++ b/src/backend/utils/misc/help_config.c
@@ -9,21 +9,20 @@
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/utils/misc/help_config.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#include <float.h>
#include <limits.h>
#include <unistd.h>
#include "utils/guc_tables.h"
#include "utils/help_config.h"
/*
* This union allows us to mix the numerous different types of structs
* that we are organizing.
diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h
index d31c28f7d4..937d91f927 100644
--- a/src/include/port/win32_port.h
+++ b/src/include/port/win32_port.h
@@ -495,21 +495,23 @@ typedef long ssize_t;
#else
typedef __int64 ssize_t;
#endif
typedef unsigned short mode_t;
#define F_OK 0
#define W_OK 2
#define R_OK 4
+/* Those functions are not presented on <math.h> on older versions. */
#if (_MSC_VER < 1800)
+#include <float.h>
#define isinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
#define isnan(x) _isnan(x)
#endif
/* Pulled from Makefile.port in MinGW */
#define DLSUFFIX ".dll"
#endif /* _MSC_VER */
#endif /* PG_WIN32_PORT_H */
diff --git a/src/interfaces/ecpg/pgtypeslib/datetime.c b/src/interfaces/ecpg/pgtypeslib/datetime.c
index 1e692a5f9e..ed321febf2 100644
--- a/src/interfaces/ecpg/pgtypeslib/datetime.c
+++ b/src/interfaces/ecpg/pgtypeslib/datetime.c
@@ -1,17 +1,16 @@
/* src/interfaces/ecpg/pgtypeslib/datetime.c */
#include "postgres_fe.h"
#include <time.h>
#include <ctype.h>
-#include <float.h>
#include <limits.h>
#include "extern.h"
#include "dt.h"
#include "pgtypes_error.h"
#include "pgtypes_date.h"
date *
PGTYPESdate_new(void)
{
diff --git a/src/port/rint.c b/src/port/rint.c
index d27fdfa6b4..d59d9ab774 100644
--- a/src/port/rint.c
+++ b/src/port/rint.c
@@ -5,21 +5,20 @@
*
* By Pedro Gimeno Fortea, donated to the public domain
*
* IDENTIFICATION
* src/port/rint.c
*
*-------------------------------------------------------------------------
*/
#include "c.h"
-#include <float.h>
#include <math.h>
/*
* Round to nearest integer, with halfway cases going to the nearest even.
*/
double
rint(double x)
{
double x_orig;
double r;
diff --git a/src/port/snprintf.c b/src/port/snprintf.c
index 8358425980..a184134ee6 100644
--- a/src/port/snprintf.c
+++ b/src/port/snprintf.c
@@ -26,23 +26,20 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* src/port/snprintf.c
*/
#include "c.h"
#include <ctype.h>
-#ifdef _MSC_VER
-#include <float.h> /* for _isnan */
-#endif
#include <limits.h>
#include <math.h>
#ifndef WIN32
#include <sys/ioctl.h>
#endif
#include <sys/param.h>
#ifndef NL_ARGMAX
#define NL_ARGMAX 16
#endif
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index 7060b6fbf3..97a50f30e7 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -9,21 +9,20 @@
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/test/regress/regress.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#include <float.h>
#include <math.h>
#include <signal.h>
#include "access/htup_details.h"
#include "access/transam.h"
#include "access/tuptoaster.h"
#include "access/xact.h"
#include "catalog/pg_type.h"
#include "commands/sequence.h"
#include "commands/trigger.h"
On 2018-Jul-10, Emre Hasegeli wrote:
isnan() function is evidently not present on <math.h> on Windows
before Visual Studio 2013. We define it on win32_port.h using
_isnan(). However _isnan() is also not present. It is on <float.h>.
The patch is attached to include this from win32_port.h.Thanks to Thomas Munro for point this out to me [1]. It is hard to
notice this issue without testing the changes on Windows.
Oh, it looks like commits 33a7101281c6, 8e211f539146, 86dbbf20d849
(probably others) papered over this by the expedient of adding #include
<float.h> to random .c files rather than your patch, which seems the
proper fix.
--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
On 2018-Jul-10, Emre Hasegeli wrote:
isnan() function is evidently not present on <math.h> on Windows
before Visual Studio 2013. We define it on win32_port.h using
_isnan(). However _isnan() is also not present. It is on <float.h>.
The patch is attached to include this from win32_port.h.Thanks to Thomas Munro for point this out to me [1]. It is hard to
notice this issue without testing the changes on Windows.
Oh, it looks like commits 33a7101281c6, 8e211f539146, 86dbbf20d849
(probably others) papered over this by the expedient of adding #include
<float.h> to random .c files rather than your patch, which seems the
proper fix.
I disagree --- including <float.h> in c.h, as this would have us do,
seems like a huge expansion of the visibility of that header. Moreover,
doing that only on Windows seems certain to lead to missing-header
problems in the reverse direction, ie patches developed on Windows
will fail elsewhere.
I think we should stick with the existing coding convention of including
that only in the specific .c files that need it.
regards, tom lane
On 2018-Jul-10, Tom Lane wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
Oh, it looks like commits 33a7101281c6, 8e211f539146, 86dbbf20d849
(probably others) papered over this by the expedient of adding #include
<float.h> to random .c files rather than your patch, which seems the
proper fix.I disagree --- including <float.h> in c.h, as this would have us do,
seems like a huge expansion of the visibility of that header. Moreover,
doing that only on Windows seems certain to lead to missing-header
problems in the reverse direction, ie patches developed on Windows
will fail elsewhere.
I don't think so, because that's only done for MSVC older than 2013.
Nobody uses that for new development anymore. Downloading versions
prior to 2017 is difficult enough already.
I think we should stick with the existing coding convention of including
that only in the specific .c files that need it.
It seems saner to contain the ugliness to a port-specific file, where it
won't pollute two dozen files for no reason.
--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
On 2018-Jul-10, Tom Lane wrote:
I disagree --- including <float.h> in c.h, as this would have us do,
seems like a huge expansion of the visibility of that header. Moreover,
doing that only on Windows seems certain to lead to missing-header
problems in the reverse direction, ie patches developed on Windows
will fail elsewhere.
I don't think so, because that's only done for MSVC older than 2013.
Nobody uses that for new development anymore.
Hm. OK, maybe it's all right given that. I'm still a bit worried
about downsides, but no doubt the buildfarm will tell us.
regards, tom lane
On Tue, Jul 10, 2018 at 04:23:42PM -0400, Tom Lane wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
On 2018-Jul-10, Tom Lane wrote:
I disagree --- including <float.h> in c.h, as this would have us do,
seems like a huge expansion of the visibility of that header. Moreover,
doing that only on Windows seems certain to lead to missing-header
problems in the reverse direction, ie patches developed on Windows
will fail elsewhere.I don't think so, because that's only done for MSVC older than 2013.
Nobody uses that for new development anymore.Hm. OK, maybe it's all right given that. I'm still a bit worried
about downsides, but no doubt the buildfarm will tell us.
It seems to me that this patch is a good idea. Any objections if I take
care of it? I have a Windows VM with only MSVC 2015 if I recall
correctly though...
--
Michael
On 2018-Jul-11, Michael Paquier wrote:
On Tue, Jul 10, 2018 at 04:23:42PM -0400, Tom Lane wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
On 2018-Jul-10, Tom Lane wrote:
I disagree --- including <float.h> in c.h, as this would have us do,
seems like a huge expansion of the visibility of that header. Moreover,
doing that only on Windows seems certain to lead to missing-header
problems in the reverse direction, ie patches developed on Windows
will fail elsewhere.I don't think so, because that's only done for MSVC older than 2013.
Nobody uses that for new development anymore.Hm. OK, maybe it's all right given that. I'm still a bit worried
about downsides, but no doubt the buildfarm will tell us.It seems to me that this patch is a good idea. Any objections if I take
care of it? I have a Windows VM with only MSVC 2015 if I recall
correctly though...
I just pushed it before seeing your message.
--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On Wed, Jul 11, 2018 at 09:13:40AM -0400, Alvaro Herrera wrote:
I just pushed it before seeing your message.
Fine as well, thanks for picking this up. The buildfarm shows no
failures about this patch.
--
Michael
Michael Paquier <michael@paquier.xyz> writes:
On Wed, Jul 11, 2018 at 09:13:40AM -0400, Alvaro Herrera wrote:
I just pushed it before seeing your message.
Fine as well, thanks for picking this up. The buildfarm shows no
failures about this patch.
I scraped all the compiler warnings from the buildfarm this morning,
and I see no new ones that could be blamed on this change, so I think
we're good.
bowerbird and hamerkop have some gripes like this:
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/Util.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/plperl.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\hstore_plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\jsonb_plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/Util.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/plperl.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\hstore_plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\jsonb_plperl.vcxproj]
but those were there before too. Not sure if there's anything
we can/should try to do about that.
regards, tom lane
On 07/12/2018 10:20 AM, Tom Lane wrote:
Michael Paquier <michael@paquier.xyz> writes:
On Wed, Jul 11, 2018 at 09:13:40AM -0400, Alvaro Herrera wrote:
I just pushed it before seeing your message.
Fine as well, thanks for picking this up. The buildfarm shows no
failures about this patch.I scraped all the compiler warnings from the buildfarm this morning,
and I see no new ones that could be blamed on this change, so I think
we're good.bowerbird and hamerkop have some gripes like this:
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/Util.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/plperl.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\hstore_plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\jsonb_plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/Util.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/plperl.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\hstore_plperl.vcxproj]
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition [G:\prog\bf\root\HEAD\pgsql.build\jsonb_plperl.vcxproj]but those were there before too. Not sure if there's anything
we can/should try to do about that.
We actually undef a bunch of things in plperl.h to keep the compiler
quiet. Maybe we need to add this to the list?
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
On 07/12/2018 10:20 AM, Tom Lane wrote:
bowerbird and hamerkop have some gripes like this:
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
We actually undef a bunch of things in plperl.h to keep the compiler
quiet. Maybe we need to add this to the list?
Perhaps. But how do we tell the platforms where we should do that
from the ones where we shouldn't?
regards, tom lane
On 07/12/2018 10:38 AM, Tom Lane wrote:
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
On 07/12/2018 10:20 AM, Tom Lane wrote:
bowerbird and hamerkop have some gripes like this:
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
We actually undef a bunch of things in plperl.h to keep the compiler
quiet. Maybe we need to add this to the list?Perhaps. But how do we tell the platforms where we should do that
from the ones where we shouldn't?
In the _MSCVER section:
#ifdef isnan
#undef isnan
#endif
By inspection the perl header is just defining it to _isnan, for every
MSC version.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Hi,
On 2018-07-12 11:28:46 -0400, Andrew Dunstan wrote:
On 07/12/2018 10:38 AM, Tom Lane wrote:
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
On 07/12/2018 10:20 AM, Tom Lane wrote:
bowerbird and hamerkop have some gripes like this:
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
We actually undef a bunch of things in plperl.h to keep the compiler
quiet. Maybe we need to add this to the list?Perhaps. But how do we tell the platforms where we should do that
from the ones where we shouldn't?In the _MSCVER section:
#ifdef isnan
#undef isnan
#endifBy inspection the perl header is just defining it to _isnan, for every MSC
version.
Let's try undefining it before plperl.h then? It'd be nice to get rid
of those warnings...
Greetings,
Andres Freund
On 11/17/18 2:46 PM, Andres Freund wrote:
Hi,
On 2018-07-12 11:28:46 -0400, Andrew Dunstan wrote:
On 07/12/2018 10:38 AM, Tom Lane wrote:
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
On 07/12/2018 10:20 AM, Tom Lane wrote:
bowerbird and hamerkop have some gripes like this:
bowerbird | c:\perl64\lib\core\win32.h(218): warning C4005: 'isnan' : macro redefinition (src/pl/plperl/SPI.c) [G:\prog\bf\root\HEAD\pgsql.build\plperl.vcxproj]
We actually undef a bunch of things in plperl.h to keep the compiler
quiet. Maybe we need to add this to the list?Perhaps. But how do we tell the platforms where we should do that
from the ones where we shouldn't?In the _MSCVER section:
#ifdef isnan
#undef isnan
#endifBy inspection the perl header is just defining it to _isnan, for every MSC
version.Let's try undefining it before plperl.h then? It'd be nice to get rid
of those warnings...
done.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Hi,
On 2018-11-18 12:46:14 -0500, Andrew Dunstan wrote:
On 11/17/18 2:46 PM, Andres Freund wrote:
On 2018-07-12 11:28:46 -0400, Andrew Dunstan wrote:
By inspection the perl header is just defining it to _isnan, for every MSC
version.Let's try undefining it before plperl.h then? It'd be nice to get rid
of those warnings...
done.
Thanks!
Greetings,
Andres Freund