Repository navigation
Fix -Wformat issues - #5769
Fix -Wformat issues#5769
Conversation
|
(PS it would be great if we could add these compiler warnings to CI to prevent regressions on this in the future) |
|
See comment on the issue thread for why |
If you would happen to that docker that reproduces that please share. It's probably just compiler version and flags but will make it easier to add. |
|
I added This is what we just talked about with @eddelbuettel about lack of CRAN reproducibility... |
|
You need r-devel. I fixed two packages in two days. Works like a charm if you have r-devel and the Makevars change. I rebuilt each day, but you should not have to. I got my first email about it while I was traveling -- Thu or Fri. edd@rob:~/git/rcppcnpy(master)$ RD --version
R Under development (unstable) (2023-11-26 r85638) -- "Unsuffered Consequences"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
edd@rob:~/git/rcppcnpy(master)$ |
|
h/t @HughParsonage for this r-package-devel thread getting directly to the issue: https://stat.ethz.ch/pipermail/r-package-devel/2023q4/010123.html That points out R itself has a new macro But we're miles away from being able to depend on such a recent addition to R. We could define the macro ourselves; it will be fragile but seems like no better choice at the moment if we want to avoid |
|
From the thread you linked it sounds |
|
I eyeballed the thread too but didn't like it much. I prefer to a) not depend on a particular version or b) make the code more complicated via an |
|
thanks all. was only wary of |
|
Considering it was commented out in CRAN release we should be good |
|
testing PR via |
| else if (TRUELENGTH(names) != oldtncol) | ||
| // Use (long long) to cast R_xlen_t to a fixed type to robustly avoid -Wformat compiler warnings, see #5768, PRId64 didnt work | ||
| error(_("Internal error: selfrefnames is ok but tl names [%ld] != tl [%ld]"), TRUELENGTH(names), oldtncol); // # nocov | ||
| error(_("Internal error: selfrefnames is ok but tl names [%ld] != tl [%d]"), TRUELENGTH(names), oldtncol); // # nocov |
There was a problem hiding this comment.
oh, interesting, does that mean TRUELENGTH(names) and TRUELENGTH(dt) have different types??
I noticed the Wformat error only hit this line once & was wondering why.
There was a problem hiding this comment.
It appears to be like that. I didn't try to understand that, just followed compiler tips.
Part of #5768
Still missing are any changes for
-Wformat-security.