[GenABEL-dev] Fwd: CRAN packages with C++11 errors on isnan or isinf
L.C. Karssen
lennart at karssen.org
Tue Nov 12 00:14:30 CET 2013
Aha, a bit more detailed explanation of the fixes I implemented earlier.
I opted for the std:isnan() from c++11.
Thanks for sharing this info,
Lennart.
On 11/10/2013 09:23 AM, Yurii Aulchenko wrote:
> fyi
>
> ---------- Forwarded message ----------
> From: *Prof Brian Ripley* <ripley at stats.ox.ac.uk
> <mailto:ripley at stats.ox.ac.uk>>
> Date: Sun, Nov 10, 2013 at 9:19 AM
> Subject: CRAN packages with C++11 errors on isnan or isinf
> To: Yurii Aulchenko <yurii at bionet.nsc.ru <mailto:yurii at bionet.nsc.ru>>,
> Daniel Taliun <Daniel.Taliun at eurac.edu
> <mailto:Daniel.Taliun at eurac.edu>>, Cedric E Ginestet
> <cedric.ginestet at kcl.ac.uk <mailto:cedric.ginestet at kcl.ac.uk>>, Philip
> Johnson <plfjohnson at emory.edu <mailto:plfjohnson at emory.edu>>, Franck
> Picard <franck.picard at univ-lyon1.fr
> <mailto:franck.picard at univ-lyon1.fr>>, The Minh Luong <luongtm at yahoo.com
> <mailto:luongtm at yahoo.com>>
> Cc: CRAN <CRAN at r-project.org <mailto:CRAN at r-project.org>>
>
>
> This concerns packages
>
> DatABEL GWAtoolbox GenABEL LDExplorer NetworkAnalysis adaptivetau cghseg
> postCP
>
> for which we have reported errors on g++ 4.8.x (and clang++ using g++
> headers showing on the CRAN check pages) like
>
> CastUtils.cpp: In function 'bool checkNan(void*, int)':
> CastUtils.cpp:189:38: error: call of overloaded 'isnan(double&)' is
> ambiguous
> return isnan(*(double*) data);
>
> isnan is a macro in C99 included in <math.h>.
>
> isnan is a function in C++11 in <cmath>, overloaded for float, double
> and long double and maybe more types.
>
> In tracking down a similar issue we found it was due to including both
> <math.h> and <cmath>. That package did so explicitly, but it is easy
> for this to be done by other headers you include.
>
> A remedy was to use std::isnan if you want the C++11 version and ::isnan
> if you want the C99 version. But note that C++98 (the default standard)
> includes neither, so the most portable thing to do is to use R's ISNAN
> via header <R.h> (and for safety include that header after all the
> system ones).
>
>
> isinf is analogous, with R_FINITE available.
>
> --
> Brian D. Ripley, ripley at stats.ox.ac.uk
> <mailto:ripley at stats.ox.ac.uk>
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~__ripley/
> <http://www.stats.ox.ac.uk/~ripley/>
> University of Oxford, Tel: +44 1865 272861
> <tel:%2B44%201865%20272861> (self)
> 1 South Parks Road, +44 1865 272866
> <tel:%2B44%201865%20272866> (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
> <tel:%2B44%201865%20272595>
>
>
>
> --
> -----------------------------------------------------
> Yurii S. Aulchenko
>
> [ LinkedIn <http://nl.linkedin.com/in/yuriiaulchenko> ] [ Twitter
> <http://twitter.com/YuriiAulchenko> ] [ Blog
> <http://yurii-aulchenko.blogspot.nl/> ]
>
>
> _______________________________________________
> genabel-devel mailing list
> genabel-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-devel
>
--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
Utrecht
The Netherlands
lennart at karssen.org
http://blog.karssen.org
GPG key ID: A88F554A
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: OpenPGP digital signature
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20131112/37850775/attachment.sig>
More information about the genabel-devel
mailing list