Re: missing isinf declaration on solaris

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Oskari Saarenmaa <os(at)ohmu(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: missing isinf declaration on solaris
Date: 2014-09-24 22:32:00
Message-ID: 54234660.4010106@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/24/14 4:26 PM, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> On 9/24/14 9:21 AM, Tom Lane wrote:
>>> Agreed, but what about non-GCC compilers?
>
>> Stick AC_PROG_CC_C99 into configure.in.
>
> I think that's a bad idea, unless you mean to do it only on Solaris.
> If we do that unconditionally, we will pretty much stop getting any
> warnings about C99-isms on modern platforms. I am not aware that
> there has been any agreement to move our portability goalposts up
> to C99.

I don't disagree with that concern. But let's look at it this way.

isinf() is a C99 function. If we want to have it, the canonical way is
to put the compiler into C99 mode. Anything else is just pure luck
(a.k.a. GNU extension). It's conceivable that on other platforms we
fail to detect a system isinf() function because of that. The only way
we learned about this is because the current configure check is
inconsistent on Solaris.

The first thing to fix is the configure check. It shouldn't detect a
function if it creates a warning when used.

What will happen then is probably that isinf() isn't detected on
Solaris, and we use the fallback implementation. Are we happy with
that? Maybe.

If not, well, then we need to put the compiler into C99 mode. But then
it's not a Solaris-specific problem anymore, because Solaris will then
behave like any other platform in this regard.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2014-09-24 22:45:42 Re: proposal: rounding up time value less than its unit.
Previous Message Alvaro Herrera 2014-09-24 21:46:30 Re: Add CREATE support to event triggers