[Rcpp-devel] Fwd: CRAN packages with C++ compilation errors on OS X 10.9

Romain Francois romain at r-enthusiasts.com
Thu Oct 31 17:56:23 CET 2013


Le 31/10/2013 17:36, Dirk Eddelbuettel a écrit :
>
> On 31 October 2013 at 17:15, Romain Francois wrote:
> | Le 31/10/2013 15:59, baptiste auguie a écrit :
> | > "OS X 10.9 (aka Mavericks) has a new C++ compiler, clang++ with libcxx
> | > headers/runtime.  Your package fails to compile with that compiler: see
> | > the appropriate log at http://www.stats.ox.ac.uk/pub/__bdr/Mavericks/
> | > <http://www.stats.ox.ac.uk/pub/bdr/Mavericks/> ."
> |
> | I sent you a pull request on github.
> |
> | .function abuses the compiler recognition, it is just unfortunate that
> | something else is called function, which is what confused it.
> |
> | Not sure there could be defenses against it.
> |
> | In the meantime, you should be fine by just using Rcpp::function
>
> Can you think of a solution at our end that will work with existing code yet
> also accomodates the newest clang version?

Maybe. This seems to be related to the <functional> header. We use this 
only for unary_function and binary_function, e.g. :

template <typename T, typename OUT = SEXP>
     class unary_call : public std::unary_function<T,OUT> {

We don't really need those sa they are trivial classes just there for 
the purpose of adding some typedefs:

template <class Arg, class Result>
   struct unary_function {
     typedef Arg argument_type;
     typedef Result result_type;
   };

Easy to replicate without including functional.

> If you check the 'bdr' URL above you will see that this affects 10 packages,
> and I recognise several (though not all) as Rcpp users.
>
> Dirk



-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30



More information about the Rcpp-devel mailing list