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

Define STRICT_R_HEADERS and include cfloat in two files #149

Merged
merged 1 commit into from
May 1, 2021

Conversation

eddelbuettel
Copy link
Contributor

Hi Sebastian,

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

Here, I prefixed two #include <Rcpp.h> with STRICT_R_HEADERS. One additional change that is needed is the #include (or <float.h> if you prefer C style) , that is equivalent). We now can use DBL_MIN. One could (and I would) add STRICT_R_HEADERS to all files with #include Rcpp.h, but I left that to him---not everybody likes more invavise PRs.

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
RcppCore/Rcpp#1158
to confirm?

Many thanks for your help, and I hope you continue to find Rcpp helpful. Please don't hesitate to ask if you have any questions.

@SebKrantz
Copy link
Owner

Thanks Dirk, my comprehension of this issue is certainly limited, but I'm happy to apply it if nothing else changes in the way the code is compiled.

@SebKrantz SebKrantz merged commit 33f09ea into SebKrantz:master May 1, 2021
@eddelbuettel
Copy link
Contributor Author

It really is just a minor cleanup which, ideally, would not be needed if we had had this enabled all along. But it will be better once we do, likely in Rcpp 1.0.8 or 1.0.9. There is not much other detail but you can look in Writing R Extensions for a little bit on it.

@eddelbuettel
Copy link
Contributor Author

And to be clear when I say "cleanup" I mean if changes made necessary by the desired change in Rcpp. The code you had was valid, it just needs this little tweak under STRICT_R_HEADERS.

@SebKrantz
Copy link
Owner

Ok, thanks for clarifying. If there is anything I'll probably find it in my tests anyway.

@eddelbuettel
Copy link
Contributor Author

"In theory": maybe. "In practice:" nope, as it is strictly a compile-time thing.

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 this pull request may close these issues.

2 participants