[R-pkg-devel] Canonical way to Rprintf R_xlen_t

Hugh Parsonage hugh@p@r@on@ge @end|ng |rom gm@||@com
Tue Nov 28 20:11:23 CET 2023


Hello,

I've been asked to update my package which contains numerous instances of

Rprintf("%lld", xlength(x));

that is, erroneously using %lld for objects of type R_xlen_t.  Having
searched for the correct way, I seem to have come across 3 competing
approaches:

Rprintf("%lld", (long long) xlength(x));
Rprintf("%td, xlength(x));
or
using the string macro found in Mr Kalibera's commit of r85641: R_PRIdXLEN_T

Which would be most advisable for my update, required in the next fortnight?


Hugh Parsonage



More information about the R-package-devel mailing list