Skip to content

Comments

Use Rcpp's stop and warning functions#2

Merged
kongdd merged 1 commit intoCUG-hydro:masterfrom
Enchufa2:master
Jan 23, 2026
Merged

Use Rcpp's stop and warning functions#2
kongdd merged 1 commit intoCUG-hydro:masterfrom
Enchufa2:master

Conversation

@Enchufa2
Copy link
Contributor

This PR provides warning and error handlers that use Rcpp's warning and stop functions respectively.

This is particularly important for the case of errors, because calling Rf_error directly prevents stack unwinding, and therefore memory leaks may happen. See this issue 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.

@kongdd
Copy link
Member

kongdd commented Jan 23, 2026

Thanks for your PR. It looks good.

@kongdd kongdd merged commit 2e111f1 into CUG-hydro:master Jan 23, 2026
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

Successfully merging this pull request may close these issues.

2 participants