PgSQL 7.4.2 - NaN on Tru64 UNIX

From: Nikola Milutinovic <Nikola(dot)Milutinovic(at)ev(dot)co(dot)yu>
To: pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: PgSQL 7.4.2 - NaN on Tru64 UNIX
Date: 2004-05-16 13:07:51
Message-ID: 40A767A7.5090701@ev.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

Hi guys.

I have just had some problems resolved while building PostgreSQL 7.4.2
on Tru64 UNIX 5.1B.

File "./src/backend/utils/adt/float.c" uses "NAN" on two spots. It ahs a
fall-back definition of NAN as:

#define NAN 0.0/0.0

This compiles on Tru64 4.0D (the compiler swallows it), but fails on
Tru64 UNIX 5.1B. Both basic CC and DTK Compaq CC break on that file
complaining on that constant evaluation. The best way to solve it is to
use system definition of "Infinity Constants". This definition is best
placed in src/include/port/osf1.h This will work on both 5.1B and 4.0D.

This is the patch:

Papa-Legba:/home/r/root/5.1/postgresql-7.4.2# diff -c
src/include/port/osf.h_ORIG src/include/port/osf.h
*** src/include/port/osf.h_ORIG Sun May 16 14:14:22 2004
--- src/include/port/osf.h Sun May 16 14:17:57 2004
***************
*** 5,7 ****
--- 5,17 ----
/*typedef msemaphore slock_t;*/
#include <alpha/builtins.h>
typedef volatile long slock_t;
+
+ /*
+ * This is for NaN (Not a Number) definition.
+ * Note that general definition in PostgreSQL is not type specific, IOW,
+ * PgSQL's definition can be used in all floating point contexts. The
+ * definition given here is for "double NaN", since all sources using it
+ * are using it in "double float" context.
+ */
+ #include <nan.h>
+ #define NAN DBL_INFINITY

The compilation has went smoothly, I'll try to run regression tests.
Will let you know if something fails.

Nix.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2004-05-16 16:27:58 one to many
Previous Message Dennis Gearon 2004-05-15 21:32:57 Re: Interesting Unique Index Needed - Functional?

Browse pgsql-hackers by date

  From Date Subject
Next Message Bastian Blank 2004-05-16 13:44:50 SIGPIPE does not try to cancel a query
Previous Message Gaetano Mendola 2004-05-16 02:36:55 Email data type

Browse pgsql-patches by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-05-16 14:48:23 Bug in CVS pg_dump against 7.0.x
Previous Message David Fetter 2004-05-15 21:55:27 Re: YA dollar quoting patch