-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[R-package] suppress Wcast-function-type warning in CMake-based gcc and MinGW builds (fixes #4273) #4274
Conversation
…nd MinGW builds (fixes microsoft#4273)
I've converted this back to a draft. It seems All CMake-based builds from https://github.com/microsoft/LightGBM/pull/4274/checks?check_run_id=2550215720 are failing with this warning.
The
link: https://github.com/microsoft/LightGBM/pull/4274/checks?check_run_id=2550215720 and
link: https://github.com/microsoft/LightGBM/pull/4274/checks?check_run_id=2550215599 So now I think that maybe it would be better to suppress this from the CMake side (but only for the R package). |
Ok I think this has successfully suppressed this warning, and this PR is ready for review.
|
@jameslamb |
I think it can be reviewed. I interpreted the most recent comment in that discussion, #4273 (comment) , as saying "ok actually it's not related to use or missing use of Given the wide range of operating system + R version + compiler versions the R package is tested against, I'm fairly confident that this warning can be ignored and that it would improve the user experience to suppress it. |
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've checked all CI logs to make sure that proposed if condition doesn't leave uncovered cases.
And I'm OK to ignore this warning.
ok thanks very much! |
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
This PR fixes #4273. It proposes suppressing this warning on CMake-based builds of the R package using
gcc
orMinGW
:This PR proposes suppressing this warning specifically for the portion of
lightgbm_R.cpp
that handles routine registration. The pattern used in {lightgbm} is exactly the same one used in many other R packages on CRAN (https://github.com/search?q=R_CallMethodDef+org%3Acran+filename%3A*.cpp), and the extensive unit tests covering the package give me confidence that this isn't causing any issues.I think that removing this warning is useful because it remove unnecessary noise from users' logs and might prevent users who are trying to debug installations issues from spending time focused on warnings that are not actually problematic.
Notes for reviewers
See #4273 for more details on this warning.
See https://cran.r-project.org/doc/manuals/r-release/R-exts.html#useDynLib and the description in #4155 for more background information on how routine registration in R packages works.
CRAN does have a rule preventing the of pragmas that suppress warnings, but the pragmas introduced in this PR will be removed when preparing a CRAN package.
LightGBM/build-cran-package.sh
Line 94 in 08d1ce4