This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/10844: Wrong computation on nan initialized vectors.
- From: ehrhardt at mathematik dot uni-ulm dot de
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, szegedy at or dot uni-bonn dot de
- Date: 19 May 2003 12:01:16 -0000
- Subject: Re: c/10844: Wrong computation on nan initialized vectors.
- Reply-to: ehrhardt at mathematik dot uni-ulm dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, szegedy at or dot uni-bonn dot de, gcc-gnats at gcc dot gnu dot org
Synopsis: Wrong computation on nan initialized vectors.
State-Changed-From-To: feedback->closed
State-Changed-By: cae
State-Changed-When: Mon May 19 12:01:16 2003
State-Changed-Why:
Oh! I was about to believe you that this is a bug but it is not.
The nan () function was introduced into math.h with the c99 standard
but the default used by gcc is the c89 standard. With this standard the
nan function is #ifdef'ed out intentionally. Hence there is no prototype
for nan (as -Wall would have told you)! Hence gcc assumes that the
return value of nan is int not double.
Adding the prototype manually or using the -std=c99 option will make the
problem go away.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10844