Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork219
Closed
Description
When this macro is not defined, R headers do define macros with very generic names, such asFree for S-PLUS back compatibility:
https://github.com/wch/r-source/blob/trunk/src/include/R_ext/RS.h#L70
#ifndefSTRICT_R_HEADERS/* S-PLUS 3.x but not 5.x NULLs the pointer in the following */#defineCalloc(n,t) (t *) R_chk_calloc( (R_SIZE_T) (n), sizeof(t) )#defineRealloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (R_SIZE_T)((n) * sizeof(t)) )#defineFree(p) (R_chk_free( (void *)(p) ), (p) = NULL)#endif
https://github.com/wch/r-source/blob/trunk/src/include/R_ext/RS.h#L49
#ifndefSTRICT_R_HEADERS#defineR_PROBLEM_BUFSIZE4096/* Parentheses added for FC4 with gcc4 and -D_FORTIFY_SOURCE=2 */#definePROBLEM{char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,#defineMESSAGE {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,#defineERROR),error(R_problem_buf);}#defineRECOVER(x)),error(R_problem_buf);}#defineWARNING(x)),warning(R_problem_buf);}#defineLOCAL_EVALUATOR/**/#defineNULL_ENTRY/**/#defineWARNWARNING(NULL)#endif
Andhttps://github.com/wch/r-source/blob/trunk/src/include/R_ext/Constants.h#L35
#ifndef STRICT_R_HEADERS#definePI M_PI#include<float.h>/* Defines the rest, at least in C99*/#defineSINGLE_EPS FLT_EPSILON#defineSINGLE_BASE FLT_RADIX#defineSINGLE_XMIN FLT_MIN#defineSINGLE_XMAX FLT_MAX#defineDOUBLE_DIGITS DBL_MANT_DIG#defineDOUBLE_EPS DBL_EPSILON#defineDOUBLE_XMAX DBL_MAX#defineDOUBLE_XMIN DBL_MIN#endif
For example theFree macro was making noise in arrow:romainfrancois/arrow@79c5001#diff-65a2f88d0196bb912b5ba669f5792492R20
So, should Rcpp havedefine STRICT_R_HEADERS somewhere ?
Metadata
Metadata
Assignees
Labels
No labels