Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found non-API calls to R: SETLENGTH, SET_TRUELENGTH #355

Closed
jwood000 opened this issue May 1, 2024 · 2 comments · Fixed by #362
Closed

Found non-API calls to R: SETLENGTH, SET_TRUELENGTH #355

jwood000 opened this issue May 1, 2024 · 2 comments · Fixed by #362

Comments

@jwood000
Copy link

jwood000 commented May 1, 2024

Recently, my package RcppAlgos started getting NOTEs on several builds from CRAN checks:

https://cran.r-project.org/web/checks/check_results_RcppAlgos.html

The NOTE is: "Found non-API calls to R: SETLENGTH, SET_TRUELENGTH"

I did many grep checks in my code repository and could not find and occurrence of SETLENGTH or SET_TRUELENGTH. I then googled the NOTE and several packages popped up. All of them that I checked depend on cpp11.

I then found this issue for arrow, apache/arrow#41404, which talks about this problem as well.

Both of these calls appear occurring in the r_vector header:

inline SEXP truncate(SEXP x, R_xlen_t length, R_xlen_t capacity) {
#if R_VERSION >= R_Version(3, 4, 0)
SETLENGTH(x, length);
SET_TRUELENGTH(x, capacity);
SET_GROWABLE_BIT(x);
#else

I also found this from r-source/wch in src/library/tools/R/sotools.R (check out lines 561 to 669):

https://github.com/wch/r-source/blob/becbbf2a71ed56d4f7503d2dc4ac391d8c05eac6/src/library/tools/R/sotools.R#L561-L669

I'm not really sure what action to take here, I just wanted to bring this to your attention.

Regards,
Joseph

@chainsawriot
Copy link

Can the first SETLENGTH be replaced by

x = Rf_xlengthgets(x, length); 

?

@chainsawriot
Copy link

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 a pull request may close this issue.

2 participants