This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/5277: NaN unexpectedly
- From: "Knox S. Long" <long at stsci dot edu>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 6 Jan 2002 18:36:01 -0000
- Subject: Re: c/5277: NaN unexpectedly
- Reply-to: "Knox S. Long" <long at stsci dot edu>
The following reply was made to PR c/5277; it has been noted by GNATS.
From: "Knox S. Long" <long@stsci.edu>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, long@stsci.edu,
gcc-bugs@gcc.gnu.org
Cc:
Subject: Re: c/5277: NaN unexpectedly
Date: Sun, 06 Jan 2002 13:33:49 -0500
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5277
Mea culpa! I now understand the cause of this problem and I don't know whether it
is a bug or not. In all of the cases in which this problem appeared, it was in
a function which had been declared as a double, e.g.
double
thierry_velocity (x, v)
double x[];
double v[];
{
int n; ...
In this particular case what was being calculated was a velocity v from a position
x. The routine was returning the speed, which is simply a double precision number.
In this and all of the other cases where I observed this problem, the routine had
not been declared as a double in the calling routine (since I was not actually
interested in the returned value). Once this was done the program, all spurious
instances on Nan disappeared.
I have no idea of course whether this is the expected performance of gcc, though
certainly the problem is not dire for me if it is. It was lesson to me to use
-Wall on anything I really seriously care about.
I apologize to anyone this has inconvenienced.
Sincerely,
Knox Long