Skip to content

Use Rcpp's stop function #24

@dewittpe

Description

@dewittpe

I was alerted to this issue in a PR for my cpr package: dewittpe/cpr#63

This PR replaces calls to Rf_error with Rcpp::stop, which is the proper way of raising an error via Rcpp. Consequently, a bunch of tests have been adjusted to check just for an error instead of a simpleError.
The issue is that calling Rf_error directly prevents stack unwinding, and therefore memory leaks may happen. See RcppCore/Rcpp#1247 for further discussion.
At Rcpp, we plan to warn about this usage, and at some point stop the compilation with an error message. Therefore, we kindly ask you to apply this patch and send an update to CRAN at your earliest convenience.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions