Skip to content

unused variable warnings issued by Rcpp #22

@ablaette

Description

@ablaette

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions