[Rcpp-devel] Moving towards STRICT_R_HEADERS in Rcpp.h

Dirk Eddelbuettel edd at debian.org
Wed Apr 28 00:17:49 CEST 2021


Some of you may have seen the earlier discussions at GitHub about enabling
STRICT_R_HEADERS by default.  The _Writing R Extensions_ manual recommends
it, but somehow we didn't do this right at the start. And prior attempts at
enabling it stopped when we saw that "a few dozen" packages (at CRAN) that
use Rcpp would be affected.  It is now a few years later, and the count is
still at "just a few dozen" so we started to ask for help in making this
change.

The GitHub issue ticket at
  https://github.com/RcppCore/Rcpp/issues/1158
has more details, as well as a list of just over 50 packages that are
affected.  So far I contacted about ten: some via a PR (if I found the
package at GitHub), the others by email (hoping the email makes it, not all
hosts like my Comcast-based setup here...). I even heard back from a few
already which is fabulous--thank you!

This would of course go faster if I could count on some help. If your package
is on the list, please take a look.

In a nutshell
- precede '#include <Rcpp.h>' with '#define STRICT_R_HEADERS' and build
- the top of issue #1158 referenced above has the most common cases:
  - sometimes it is just swapping PI for M_PI
  - sometimes it is just adding '#include <float.h>' (or cfloat) as
    otherwise things like FLT_MIN or DBL_MIN are no longer known

And there is even a helper script testing for the common case which Inaki put
together, you find it here:
  https://github.com/RcppCore/rcpp-logs/blob/master/scripts/strictHeaders.R
and you can run it via 'r' (littler) or 'Rscript'.

In short, it's a five-minute job, including testing.  And we are *not* in a
hurry.  But help would be really, truly, greatly appreciated.

Let us know if you have questions, either here or at #1158 as a follow-up.

Thanks, and onwards towards 'Stricter R headers'!

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list