[Rcpp-devel] -Wconversion

Kirill Müller kirill.mueller at ivt.baug.ethz.ch
Thu Apr 27 22:43:58 CEST 2017

For RSQLite, I wanted to double-check that I'm not inadvertently 
truncating integer values. Unfortunately, enabling -Wconversion gives me 
several false positives that originate from Rcpp headers.

I was able to fix these locally by editing 11 header files (see list 
below), mostly by replacing int with size_t or R_xlen_t, or by adding 
casts. Happy to submit several pull requests, but wanted to discuss 
scope and granularity first:

- one PR each for Dimension.h, api/, date_datetime/, module/, sugar/, 
- one PR per affected file
- one PR per affected line of code?


  M inst/include/Rcpp/Dimension.h
  M inst/include/Rcpp/api/meat/module/Module.h
  M inst/include/Rcpp/date_datetime/Date.h
  M inst/include/Rcpp/date_datetime/Datetime.h
  M inst/include/Rcpp/date_datetime/newDateVector.h
  M inst/include/Rcpp/date_datetime/newDatetimeVector.h
  M inst/include/Rcpp/module/Module.h
  M inst/include/Rcpp/sugar/functions/rowSums.h
  M inst/include/Rcpp/sugar/functions/sample.h
  M inst/include/Rcpp/sugar/functions/strings/trimws.h
  M inst/include/Rcpp/vector/no_init.h

More information about the Rcpp-devel mailing list