Ticket #117 (defect)
Opened 2 years ago
Last modified 2 years ago
build fails because "isnan" not declared (gr_math.cc)
Status: closed (fixed)
| Reported by: | dward | Assigned to: | eb |
|---|---|---|---|
| Priority: | normal | Milestone: | release-3.0.3 |
| Component: | gnuradio-core | Version: | 3.0svn |
| Keywords: | Cc: | don2387ward@sprynet.com | |
Build from latest SVN fails on Cygwin (gcc 3.4.4) and MinGW/MSYS (gcc 3.4.5) because
gr_math.cc: In function `int gr_isnan(double)': gr_math.cc:66: error: `isnan' was not declared in this scope
In these versions of g++ isnan is defined as a macro in <math.h> unless <cmath> is included, in which case std::isnan() is defined instead. The configure script (config/lf_cxx.m4) uses <math.h> and thus doesn't find std::isnan(), but (since revision 4108) gr_math.h includes <gr_complex.h> which indirectly includes <cmath>. So std::isnan() is defined, but CXX_HAS_STD_ISNAN is not defined, and isnan (as a macro) is not defined.
It seems that the test for isnan performed in lf_cxx.m4 should match the usage of isnan in the code---either both should include <cmath> or neither should include <cmath>.
At present (since revision 4108), all code in GNU Radio that references isnan includes <cmath>; attached is a patch for lf_cxx.m4 that works in this case.
Attachments
Change History
12/18/06 08:26:30: Modified by dward
- attachment lf_cxx.patch added.
12/18/06 10:55:42: Modified by eb
- status changed from new to closed.
- resolution set to fixed.
Patch applied in r4137. Thanks Don!
02/07/07 13:17:43: Modified by jcorgan
- milestone changed from to-be-decided to release-3.0.3.

use <cmath> instead of <math.h> for isnan