Fix -Wextra#1485
Conversation
|
Thanks but please see the file Contributing.md -- prior discussion is always best before throwing a PR over the fence which touches eighteen files and comes from someone we never interacted with (as far as I can tell). |
|
A priori, I am sympapthetic. I have used
so it is a little outside the norm. We are about to release 1.1.2 in out usual 'January and July' cadence but maybe we can look into this for the release thereafter, i.e. January 2027. |
|
sure, I just thought it was a rather simple change, since it doesn't touch any real logic. Do you want me to close it or leave it open and rebase it later? |
|
Can we maybe decompose it into individual warnings and among the team (with between us decades of You appear to be associated with gentoo. Does |
|
This is unrelated to Gentoo, this is something I'm seeing in our corporate codebase (where we do enable |
|
I am quite religious about |
|
Sure, the biggest problem for the main codebase (not in the headers) is the works? |
|
There should be none in the |
|
In principle I'm okay with this change, but IMHO it's not really about fixing -Wextra warnings, it's about whether we're willing to commit to doing this from now and into the future. That probably also implies us building and testing Rcpp with -Wextra on CI, so we don't regress this in the future. I also worry that there's some amount of divergence in what -Wextra means, based on the compiler used, its version, and so on -- since IIUC the set of compiler flags in -Wextra is itself a moving target. My two cents... |
|
yeah, just double-checked, they're fine (I saw the @kevinushey oh it is, but |
|
.... which is a flag that R itself will complain about as 'not portable' (cf other discussion on |
|
It would have been nice to discuss these as separate issues. My two cents about the copy constructor. In general, I prefer to solve warnings rather than just silencing them. Adding a default constructor does the latter, because it's something the compiler already does for us. Having a custom assignment operator but not a copy constructor is what triggers the warning. So the question for me is whether we need a custom copy operator too, or if the assignment operator is needed at all. Correct me if I'm wrong, but if we remove it, the compiler generates a default one that delegates to the base class, which already handles the assignment nicely (i.e. shares the underlying SEXP, which has the tzone attribute already). |
|
As for
|
|
Fixes for when building under
-Wextra, particularly for users who want to compile their Rcpp code with-Wextra.Checklist
R CMD checkstill passes all tests