FWIW  Rcpp handles this (for CLOENV) with an ifdef:

            #if (defined(R_VERSION) && R_VERSION >= R_Version(4,5,0))
            return R_ClosureEnv(fun);
            #else
            return CLOENV(fun);
            #endif

https://github.com/RcppCore/Rcpp/blob/257e1977cd6e251d0a3d691050ad43fa29cf9666/inst/include/Rcpp/Function.h#L102-L106

On 3/19/25 11:08, Josiah Parry wrote:
I'm trying to work through some new WARNINGs that I am experiencing *only* in
R-devel.

  Found non-API calls to R: ‘BODY’, ‘CLOENV’, ‘ENCLOS’, ‘FORMALS’

Take FORMALS, for example. IIUC, we should now be using R_ClosureFormals
instead. However, my understanding is that this is available only in R 4.5
main trunk.

If migrating to the R_ClosureFormals, should the minimum version of R for
the package be recorded in the DESCRIPTION as R >= 4.5?

Additionally, I'm somewhat at a loss for how to pass CRAN checks for
R-release and R-devel while using only R_ClosureFormals to adhere to
R-devel WARNING.

Should old versions have an upper bound on the supported R version as well
as a lower one e.g. Depends may have R >=4.1.0 <4.5.0?

Thanks in advance for your advice / insight!

- Josiah

        [[alternative HTML version deleted]]

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
* E-mail is sent at my convenience; I don't expect replies outside of working hours.

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to