Xtide Broken on X86 X64 current

Lowell Gilbert freebsd-ports-local at be-well.ilk.org
Thu Oct 2 20:37:38 UTC 2014


Manfred Antar <null at pozo.com> writes:

> /usr/ports/astro/xtide doesn't complie on amd64 or i386 current for me
> It uses /usr/local/bin/gcc48 for compiler.
> System is current.
> The error is :
>
> xxGlobal.cc: In function 'void Global::PositioningSystem(Coordinates&)':
> xxGlobal.cc:80:24: error: 'isnan' was not declared in this scope
>          if (!(isnan(lat) || isnan(lng))) {
>                         ^
> xxGlobal.cc:80:24: note: suggested alternative:
> In file included from /usr/local/lib/gcc48/include/c++/random:38:0,
>                  from /usr/local/lib/gcc48/include/c++/bits/stl_algo.h:65,
>                  from /usr/local/lib/gcc48/include/c++/algorithm:62,
>                  from common.hh:135,
>                  from xtide.hh:21,
>                  from xxGlobal.cc:21:
> /usr/local/lib/gcc48/include/c++/cmath:632:5: note:   'std::isnan'
>      isnan(_Tp __x)
>      ^
[...]
> If  you:
> vi ./work/xtide-2.13.2/xxGlobal.cc
>
> and add to top of file:
> extern "C" int isnan (double);
>
> It will compile.

The compiler's suggestion may be better. C and POSIX currently disagree on
what type the parameter to isnan() should be, whereas in C++ std::isnan is
safe (because of overloading). This is C++ code anyway, so you can use its
version and not worry that it will break with some future change to math.h
or even of compiler-defined constants.


More information about the freebsd-ports mailing list