Re: missing isinf declaration on solaris - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: missing isinf declaration on solaris
Date
Msg-id 54234660.4010106@gmx.net
Whole thread Raw
In response to Re: missing isinf declaration on solaris  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 9/24/14 4:26 PM, Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.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.




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Add CREATE support to event triggers
Next
From: Peter Eisentraut
Date:
Subject: Re: proposal: rounding up time value less than its unit.