kbroman / qtl

R/qtl: A QTL mapping environment
https://rqtl.org
GNU General Public License v3.0
77 stars 45 forks source link

Calloc/Realloc can no longer be used? #109

Closed kbroman closed 3 months ago

kbroman commented 3 months ago

There's a problem showing up on CRAN labeled as "Strict". It looks like we're no longer allowed to use the C functions Calloc() and Realloc(), defined in R_ext/RS.h.

simulate.c: In function 'sim_bc':
simulate.c:134:21: error: implicit declaration of function 'Calloc'; did you mean 'calloc'? [-Wimplicit-function-declaration]
  134 |     chi = (double *)Calloc(max_chi, double);
      |                     ^~~~~~
      |                     calloc
simulate.c:134:37: error: expected expression before 'double'
  134 |     chi = (double *)Calloc(max_chi, double);
      |                                     ^~~~~~
simulate.c:153:29: error: implicit declaration of function 'Realloc'; did you mean 'realloc'? [-Wimplicit-function-declaration]
  153 |             chi = (double *)Realloc(chi, max_chi, double);
      |                             ^~~~~~~
      |                             realloc
simulate.c:153:51: error: expected expression before 'double'
  153 |             chi = (double *)Realloc(chi, max_chi, double);
      |                                                   ^~~~~~
simulate.c:206:5: error: implicit declaration of function 'Free'; did you mean 'free'? [-Wimplicit-function-declaration]
  206 |     Free(chi);
      |     ^~~~
      |     free
kbroman commented 3 months ago

In the NEWS for R-devel, it says: