Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unused variable warnings issued by Rcpp #22

Closed
ablaette opened this issue Jun 25, 2021 · 1 comment
Closed

unused variable warnings issued by Rcpp #22

ablaette opened this issue Jun 25, 2021 · 1 comment

Comments

@ablaette
Copy link
Collaborator

When compiling RcppCWB you may see the following warning:

/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include/Rcpp/DataFrame.h:136:18: warning: unused variable 'data' [-Wunused-variable]
SEXP data = Parent::get__();
^

This does not result from C/C++ code of RcppCWB, but from the Rcpp package. Thus, compiling the Rcpp version currently available at CRAN (v1.0.6) also yields this warning. On my system:

../inst/include/Rcpp/DataFrame.h:136:18: warning: unused variable 'data' [-Wunused-variable]
SEXP data = Parent::get__();

This is just a warning and does not indicate real trouble. For the time being, the solution is to install an updated version of Rcpp not yet available at CRAN. A conversation on Stackoverflow explains that it is available via a drat repository:

install.packages("Rcpp", repos="https://rcppcore.github.io/drat")

The alterntive to updating Rcpp is to add the flag -Wno-unusedto the CXXFLAGS in ~/.R/Makevars, but this conceals something that can and should be fixed easily. This is why I think that using the updates of Rcpp is the better solution. In my case v1.0.6.7 did the job.

It is just a matter of time that a new Rcpp version is released via CRAN which will not result in the warning. Then this issue can be closed.

ablaette added a commit that referenced this issue Jul 15, 2021
@ablaette
Copy link
Collaborator Author

ablaette commented Dec 3, 2021

Update: The warning depends on the compiler. I see it with clang v11.0.3 (macOS), but gcc v10.3.0 (Debian). Anyway, as Rcpp v1.0.7 is available as a binary package for all systems on CRAN, requiring this version (in DESCRIPTION, Suggests:) is the solution.

@ablaette ablaette closed this as completed Dec 3, 2021
ablaette added a commit that referenced this issue Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant