[Rcpp-devel] large number of warnings for simple use of Rcpp

Guillaume Blanchet gblanchet.list at gmail.com
Mon Nov 2 19:48:30 CET 2015


Hi ! 

I apologie in advance if this question has already been answered but I have yet to find a solution to my problem.

I recently started to learn Rcpp using the book « Seamless R and C++ Integration with Rcpp » by Dirk Eddelbuettel.

Using the Fibonacci C code from the book, I tried to reproduce the example to get a feeling of how to work with Rcpp. More precisely, I wrote the following C code in a file that I called  « fibonacci.cpp ».

#include <Rcpp.h>
using namespace Rcpp;

//[[Rcpp::export]]
int fibonacci(const int x) {
	if(x < 2){
		return(x);
	}else{
		return fibonacci(x-1)+fibonacci(x-2);
	}
}

Following, I called this file using the following command line:

sourceCpp("fibonacci.cpp")

What I get in return is a series of 80 warnings. Although, these warning may be helpful to answer this question, to keep this message concise I will not attached them here. However, if you feel they maybe helpful, let me know and I will send them along. 

Note that I am currently working on a Macbook Pro with the new OS (El Capitan). Following the advice given on the CRAN, I organized the Makevar file using clang as follow:

CC=clang
CXX=clang++
CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
FLIBS=-lgfortran

Any reasons, why I get so many warnings ?

Thanks in advance for your answer ! 

Have a good day !

Guillaume





More information about the Rcpp-devel mailing list