From owner-freebsd-ports@FreeBSD.ORG Thu Oct 2 20:37:38 2014 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EE929AD; Thu, 2 Oct 2014 20:37:38 +0000 (UTC) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 4908FDA5; Thu, 2 Oct 2014 20:37:38 +0000 (UTC) Received: by be-well.ilk.org (Postfix, from userid 1147) id 604D033C4B; Thu, 2 Oct 2014 16:37:30 -0400 (EDT) From: Lowell Gilbert To: Manfred Antar Subject: Re: Xtide Broken on X86 X64 current References: <201410021826.s92IQ52J017427@pozo.com> Date: Thu, 02 Oct 2014 16:37:30 -0400 In-Reply-To: <201410021826.s92IQ52J017427@pozo.com> (Manfred Antar's message of "Thu, 02 Oct 2014 11:26:05 -0700") Message-ID: <448uky2ool.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: ports@freebsd.org, marino@freebsd.org, brion@queeg.com, freebsd@skysmurf.nl X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 20:37:38 -0000 Manfred Antar 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.