-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] investigate -Wconversion warnings (close#391) #556
Conversation
Wow! Thanks a lot for all this. I am wondering if we should break this into several separate PRs? |
In short and without having looked in great detail yet: (1) Yes, maybe in a separate PR? (2) In principle, yes. In practice, won't that force a change on a bazillion lines of user code currently using (3) Yes. (4) Yes. These are all excellent points but maybe time to disentangle? |
It might be better to break into several small PRs. I will do that later. Let's wait for some opinions from Kevin. BTW, I know you are working on a new Date class, so I didn't touch them. |
Sounds good. The branch I am currently in updates the vector version for |
Nice work! Looks good to me here as well. |
I believe we shouldn't be breaking any user code here -- I think we get automatic integral conversion from (some users might still be grumpy about it, though) |
@@ -23,12 +23,12 @@ | |||
namespace Rcpp { | |||
|
|||
inline List Module::classes_info(){ | |||
int n = classes.size() ; | |||
size_t n = classes.size() ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinushey the size_t
changes in this PR are mostly like this. No access from users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking more like https://github.com/RcppCore/Rcpp/pull/556/files#diff-a1af5c14c54d6d6907a0ca6f99d61286R69 (although that's int
to R_xlen_t
, so I misspoke earlier)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking about what X.size()
returns. Internal changes are fine, methinks.
Actually there are still tens of warnings about conversion between They might not be defined as the same on some platforms. |
Yes, |
I'm closing this one now as we are taking this one topic at a time which seems a little easier. |
I spent some time investigating the
-Wconversion
warnings and fixed most of them.Places I fixed:
(1)
string_elt
andvector_elt
should acceptR_xlen_t
(https://github.com/wch/r-source/blob/trunk/src/include/Rinternals.h#L557-L558). This is something we really need to fix.(2) length of vector should be
size_t
notint
.(3) the hashing functions should return
unsigned int
as we definedRCPP_HASH
(https://github.com/RcppCore/Rcpp/blob/master/inst/include/Rcpp/hash/IndexHash.h#L46)(4) I think
Range
sugar should acceptR_xlen_t
as start and end.Places I don't fix:
(1) warnings in
rowSums.h
(https://github.com/RcppCore/Rcpp/blob/master/inst/include/Rcpp/sugar/functions/rowSums.h#L70). I think it is fine.(2)
Date
andDatetime
. I think @eddelbuettel knows these classes far better than me, so I didn't touch them.Please take a look @kevinushey @eddelbuettel