Re: _isnan() on Windows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Emre Hasegeli <emre(at)hasegeli(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: _isnan() on Windows
Date: 2018-07-10 19:55:13
Message-ID: 24077.1531252513@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-07-10 20:07:03 Re: _isnan() on Windows
Previous Message Alvaro Herrera 2018-07-10 19:53:22 Re: no partition pruning when partitioning using array type