Skip to content

Declare C++11 need #5

Description

@romainfrancois

From BR:

This concerns packages

BDgraph Branching CAMAN DALY MCMCglmm PopGenome RCPmod Rsomoclu SGCS
SSN SpeciesMix TraMineR WhopGenome adaptivetau climdex.pcic dbarts
devEMF distory dynaTree evtree fishMod gbm gmp hdlm highlight hint
mixAK monomvn multic mvPot protViz rBeta2009 simLife
spatialsegregation stringi topicmodels wtcrsk

These use functions/macros which are not part of C++98: see the logs
at http://www.stats.ox.ac.uk/pub/bdr/C++Solaris .

Functions

erf expm1 floorf fmin fminf fmax lgamma lround loglp round snprintf
strcasecmp trunc

were introduced in C99 and so are part of C++11 but not C++98 and the
Solaris C++ compiler does not provide prototypes for them: unfortunately
g++ does not warn of this. (R is currently including from R.h legacy
headers such as math.h to work around this, but that will be changed
for R 3.4.0.)

R's Rmath.h provides fmax2 fmin2 fround ftrunc gammafn : please use
them as appropriate. Also, erf can be replaced by a call to R's pnorm (the translation is in the R help file for pnorm).

C++98's floor has a method for floats, so floorf is not needed in C++ .

Constants M_LN2 (gmp), M_SQRT2 (mixAK) and M_PI4 (simLife) are not
C++98. You can get them by including Rmath.h (or copy them from there).

For wtcrsk, isnan is not C++98, but R provides ISNAN for use in C++.

For SSN, strdup is a GNU/POSIX extension to C and not in any C++
standard hence not declared in according to the standard.
Substitutes are widely available: we suggest you use one.

For the rest, the best solution would seem to be to declare that C++11
is used: see 'Writing R Extensions'.

Please submit a corrected update, preferably within 4 weeks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions