isnan() with gcc 3.2.2 on FreeBSD 5.0-C

Stefan Farfeleder stefan at fafoe.dyndns.org
Mon Mar 31 00:49:41 PST 2003


On Mon, Mar 31, 2003 at 02:46:05PM +0800, Ying-Chieh Liao wrote:
> the following code snippet works fine with gcc 2.95.4 on RELENG_4
> but failed on my -current
> 
> <code>
> #include <iostream>
> #include <cmath>
> 
> using namespace std;
> 
> int main(void)
> {
>     cout << isnan(1.0) << endl;
>     return 0;
> }
> </code>
> 
> <err>
> test.cpp: In function `int main()':
> test.cpp:8: `isnan' undeclared (first use this function)
> test.cpp:8: (Each undeclared identifier is reported only once for each function
>    it appears in.)
> </err>
> 
> what's wrong with my system ? or what can I do for it ?

The isnan() macro is a new feature of C99 and thus not (yet) part of
C++.  Nevertheless you can use -D_GLIBCPP_USE_C99 to include this and
some other non-standard C++ features.

Regards,
Stefan Farfeleder


More information about the freebsd-questions mailing list