Enabling -Wconversion (particularly with clang++ as on the M1mac machine at CRAN, see its README) exposes a number of warnings. The Oxford machine uses clang++-21, on Ubuntu 26.04 we also have clang++-22 which Vienna uses (without the same options). Per the README this uses
CFLAGS="-falign-functions=8 -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wstrict-prototypes"
C17FLAGS="-falign-functions=8 -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-strict-prototypes"
# ...
CXXFLAGS="-g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion"
Note that this turns 'sign-conversion' warnings off. Those account for a ton. I found first set of changes we could make by not doing this i.e. by running with only -Wconversion. That may be too radical, but it could still hide some overflows.
Also, our own compilation is 'clean' under -Wconversion -Wno-sign-conversion however other package may see
In file included from /Users/ripley/R/Library/Rcpp/include/Rcpp/sugar/functions/functions.h:63:
/Users/ripley/R/Library/Rcpp/include/Rcpp/sugar/functions/mean.h:38:14: warning: implicit conversion from 'R_xlen_t' (aka 'long') to 'long double' may lose precision [-Wimplicit-int-float-conversion]
38 | s /= n;
| ~~ ^
/Users/ripley/R/Library/Rcpp/include/Rcpp/sugar/functions/mean.h:44:20: warning: implicit conversion from 'R_xlen_t' (aka 'long') to 'long double' may lose precision [-Wimplicit-int-float-conversion]
44 | s += t/n;
| ~^
Enabling
-Wconversion(particularly withclang++as on the M1mac machine at CRAN, see its README) exposes a number of warnings. The Oxford machine usesclang++-21, on Ubuntu 26.04 we also haveclang++-22which Vienna uses (without the same options). Per the README this usesNote that this turns 'sign-conversion' warnings off. Those account for a ton. I found first set of changes we could make by not doing this i.e. by running with only
-Wconversion. That may be too radical, but it could still hide some overflows.Also, our own compilation is 'clean' under
-Wconversion -Wno-sign-conversionhowever other package may see