Re: [HACKERS] PgSQL 7.4.2 - NaN on Tru64 UNIX

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nikola Milutinovic <Nikola(dot)Milutinovic(at)ev(dot)co(dot)yu>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] PgSQL 7.4.2 - NaN on Tru64 UNIX
Date: 2004-07-10 01:49:54
Message-ID: 200407100149.i6A1nsP19201@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Nikola Milutinovic wrote:
> 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.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2004-07-10 01:52:19 Re: [HACKERS] [GENERAL] PgSQL 7.4.2 - NaN on Tru64 UNIX
Previous Message Scott Marlowe 2004-07-09 22:46:47 Re: Enough RAM for entire Database.. cost aside, is this

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-07-10 01:52:19 Re: [HACKERS] [GENERAL] PgSQL 7.4.2 - NaN on Tru64 UNIX
Previous Message Bruce Momjian 2004-07-10 01:29:52 Re: More vacuum.c refactoring

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-07-10 01:52:19 Re: [HACKERS] [GENERAL] PgSQL 7.4.2 - NaN on Tru64 UNIX
Previous Message Bruce Momjian 2004-07-10 01:32:20 Re: [PATCH] s_lock support for win32