Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Oct 2014 16:37:30 -0400
From:      Lowell Gilbert <freebsd-ports-local@be-well.ilk.org>
To:        Manfred Antar <null@pozo.com>
Cc:        ports@freebsd.org, marino@freebsd.org, brion@queeg.com, freebsd@skysmurf.nl
Subject:   Re: Xtide Broken on X86 X64 current
Message-ID:  <448uky2ool.fsf@be-well.ilk.org>
In-Reply-To: <201410021826.s92IQ52J017427@pozo.com> (Manfred Antar's message of "Thu, 02 Oct 2014 11:26:05 -0700")
References:  <201410021826.s92IQ52J017427@pozo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Manfred Antar <null@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?448uky2ool.fsf>