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

From Oskari Saarenmaa
Subject Re: missing isinf declaration on solaris
Date
Msg-id 5422CD97.6030406@ohmu.fi
Whole thread Raw
In response to Re: missing isinf declaration on solaris  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
24.09.2014, 16:21, Tom Lane kirjoitti:
> Oskari Saarenmaa <os@ohmu.fi> writes:
>> ... so to enable XPG6 we'd need to use C99 mode anyway.
>
> OK.
>
>> Could we just use
>> -std=gnu99 (with -fgnu89-inline if required) with GCC on Solaris?  ISTM
>> it would be cleaner to just properly enable c99 mode rather than define
>> an undocumented macro to use a couple of c99 declarations.
>
> Agreed, but what about non-GCC compilers?

Solaris Studio defaults to "-xc99=all,no_lib" which, according to the 
man page, enables c99 language features but doesn't use c99 standard 
library semantics.  isinf is defined to be a macro by c99 and doesn't 
require changing the c99 mode so I'd just keep using the defaults with 
Solaris Studio for now.

For GCC

--- a/src/template/solaris
+++ b/src/template/solaris
@@ -0,0 +1,4 @@
+if test "$GCC" = yes ; then
+  CPPFLAGS="$CPPFLAGS -std=gnu99"
+fi
+

gets rid of the warnings and passes tests.

/ Oskari



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: make pg_controldata accept "-D dirname"
Next
From: Alvaro Herrera
Date:
Subject: Re: make pg_controldata accept "-D dirname"