Subject: lib/25930: isnan missing
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <dmcmahill@NetBSD.org>
List: netbsd-bugs
Date: 06/14/2004 21:53:53
>Number: 25930
>Category: lib
>Synopsis: isnan missing
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 14 21:54:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Dan McMahill
>Release: NetBSD 2.0_BETA
>Organization:
>Environment:
System: NetBSD ftp.netbsd.org 2.0_BETA NetBSD 2.0_BETA (NBFTP) #4: Fri Apr 16 22:40:25 EDT 2004 tls@enola-gay:/usr/src/sys/arch/i386/compile/NBFTP i386
Architecture: i386
Machine: i386
>Description:
isnan and isinf don't seem to work right in c++ programs. I always get:
foo.cpp: In function `int main(int, char**)':
foo.cpp:8: error: `isnan' undeclared (first use this function)
foo.cpp:8: error: (Each undeclared identifier is reported only once for each
function it appears in.)
Something in /usr/include/g++/cmath seems to trigger this.
>How-To-Repeat:
cat > foo.cpp << EOF
#include <iostream>
#include <cmath>
int main(int argc, char **argv)
{
double x=2.3;
std::cout << "isnan(" << x << ") = " << isnan(x) << std::endl;
return 0;
}
EOF
g++ -Wall -o foo foo.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: