pbreheny / biglasso

biglasso: Extending Lasso Model Fitting to Big Data in R
http://pbreheny.github.io/biglasso/
113 stars 29 forks source link

Switch Calloc,Free to R_Calloc,R_Free for STRICT_R_HEADERS #40

Closed eddelbuettel closed 2 years ago

eddelbuettel commented 3 years ago

Dear Chuyi, dear biglasso team,

Your CRAN package biglasso uses Rcpp, and is affected if we add a definition of STRICT_R_HEADERS as we would like to do. Please see the discussion at https://github.com/RcppCore/Rcpp/issues/1158 and the links therein for more context on this.

Here, we can prefix each #include with STRICT_R_HEADERS, or we can also define it in src/Makevars* for a more minimal changeset via -DSTRICT_R_HEADERS, or as I currently do add in the Rcpp headers. Defining it means Calloc() and Free() are no longer "visible" as the more defensively named R_Calloc() and R_Free() are preferred. The simple PR just renames them in four files.

We plan to enable STRICT_R_HEADERS by the Jan 2022 release of Rcpp, and will likely offer you a define to suppress it. So if you really do not want the change you can prevent it -- see these lines in Rcpp for details: https://github.com/RcppCore/Rcpp/blob/e79c70e76bc2a776d2d57287f7192dbdbcb292aa/inst/include/Rcpp/r/headers.h#L28-L38

It would be lovely if you could apply this. There is no strong urgency: we aim to get this done over all affected packages in the space of a few months. If you apply it, would you mind dropping me a note by email or swinging by https://github.com/RcppCore/Rcpp/issues/1158 to confirm?

Please don't hesitate to ask (here, at https://github.com/RcppCore/Rcpp/issues/1158, or via email) if you have any questions.

Many thanks for your help, and I hope you continue to find Rcpp helpful.