HenrikBengtsson / matrixStats

R package: Methods that Apply to Rows and Columns of Matrices (and to Vectors)
https://cran.r-project.org/package=matrixStats
206 stars 34 forks source link

CRAN: allocMatrix2.c:10:23: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] #223

Closed HenrikBengtsson closed 2 years ago

HenrikBengtsson commented 2 years ago

From https://cran.r-project.org/web/checks/check_results_matrixStats.html (2022-11-13);

Version: 0.62.0
Check: whether package can be installed
Result: WARN
    Found the following significant warnings:
     allocMatrix2.c:10:23: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
     allocMatrix2.c:16:26: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
Flavor: [r-devel-linux-x86_64-fedora-clang](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-clang/matrixStats-00check.html)
Version: 0.62.0
Check: whether package can be installed
Result: WARN
    Found the following significant warnings:
     allocMatrix2.c:10:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     allocMatrix2.c:16:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
Flavor: [r-devel-linux-x86_64-fedora-gcc](https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-fedora-gcc/matrixStats-00check.html)
HenrikBengtsson commented 2 years ago

This is probably because:

https://github.com/HenrikBengtsson/matrixStats/blob/49e70df9a9e100cd5eb0505230f16847499a4d53/src/allocMatrix2.c#L10-L20

should be declared as:

int memset_zero_ok_int(void) {

and

int memset_zero_ok_double(void) {

But before fixing, we should make sure we an reproduce it locally, or ideally, on GitHub Actions.