Re: [HACKERS] Regression tests on intel for 6.5.2 - Mailing list pgsql-hackers

From Christof Petig
Subject Re: [HACKERS] Regression tests on intel for 6.5.2
Date
Msg-id 37F22ABD.50997341@wtal.de
Whole thread Raw
In response to Re: [HACKERS] Regression tests on intel for 6.5.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Regression tests on intel for 6.5.2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Lamar Owen wrote:

> On Mon, 27 Sep 1999, Tom Lane wrote:
> > which is evidently doing the wrong thing on your platform.  What does
> > your man page for exp() say about error return conventions?
>

I checked it twice, I can't find any error in the current sources. I even wrote a test program:
#include <math.h>
#include <stdio.h>
#include <errno.h>

int main()
{  double e;  errno=0;  e=pow(100,200);  if (errno) perror("pow");  if (!finite(e)) puts("!finite\n");  else
printf("%f\n",e);
}

Output:
pow: Numerical result out of range
!finite

So both methods seem to work. (finite is a function on glibc-2.1 systems)

Perhaps (strange thoughts come in to my mind ...) the compiler optimizes the function call into a
machine instruction ...
/tmp> cc -O2 -o test test.c -lm
/tmp> ./test
!finite

Looks like this is the case. So (I use gcc-2.95) what to do? Complain about a compiler/library bug
(doesn't set errno)? I would propose another autoconf test. (I could easily do it.)
Christof

PS: I found the offending inline routines in /usr/include/bits/mathinline.h




pgsql-hackers by date:

Previous
From: Edmund Mergl
Date:
Subject: Win32 püort of libpq
Next
From: Thomas Lockhart
Date:
Subject: Re: Non-beta RPMS for RedHat Linux -- PostgreSQL 6.5.2