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

R changes names of constant #507

Closed
jarioksa opened this issue Mar 26, 2022 · 1 comment
Closed

R changes names of constant #507

jarioksa opened this issue Mar 26, 2022 · 1 comment

Comments

@jarioksa
Copy link
Contributor

Brian Ripley told us:

NEWS for 4.2.0 alpha (and R-devel for months before) has

• The legacy S-compatibility macros DOUBLE_* in R_ext/Constants.h
(included by R.h) are deprecated.

The plan is to remove them in R-devel soon after the release of 4.2.0, so please do so in your package before Apr 23.

The standard C99 constants are those used in that header:

#define DOUBLE_DIGITS DBL_MANT_DIG
#define DOUBLE_EPS DBL_EPSILON
#define DOUBLE_XMAX DBL_MAX
#define DOUBLE_XMIN DBL_MIN

defined in <float.h> or for C++, , so please change to those.

Unfortunately there is no portable way to give a deprecation warning in a header so once these are removed your package will fail to install.

Quick grepping found DOUBLE_XMAX in src/stepacross.c, but there may be other cases.

@jarioksa
Copy link
Contributor Author

<R.h> defined constant DOUBLE_XMAX but that will be deprecated in R 4.2.x ("were deprecated" according to the file, using past tense for future changes). Instead R will now use DBL_MAX of the compiler. The availability of this depends on the compiler, but with the current R requirements of C99, it should be available. There may be old R versions that do not require (and use!) C99, and the fix may fail there. Instead of commit 3833ad6 the following could work also in these:

/* Instead of replacing DOUBLE_XMAX (R) with DBL_MAX (compiler) of commit 3833ad6: */
#ifndef DOUBLE_XMAX
#define DOUBLE_XMAX DBL_MAX
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant