Skip to content
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

compiler warning: 'not all control paths return a value' #3067

Closed
jameslamb opened this issue May 11, 2020 · 1 comment
Closed

compiler warning: 'not all control paths return a value' #3067

jameslamb opened this issue May 11, 2020 · 1 comment

Comments

@jameslamb
Copy link
Collaborator

Thanks to @gmobaz for pointing out that building the R package with Visual Studio compilers results in a few compilation warnings (#3064 (comment)). One of these is 'not all control paths return a value'.

We should eliminate this warning if possible, to save users time in debugging.

How you are using LightGBM?

LightGBM component: R package

Environment info

Operating System: Windows 10

CPU/GPU model: N/A

C++ compiler version: Visual Studio 16 2019, MSVC 14.24.28314

CMake version: 3.16.5

Java version: N/A

Python version: N/A

R version: 3.6.1

Error message and / or logs

C:\Users\James\AppData\Local\Temp\RtmpKw7PIG\R.INSTALL3afce51189c\lightgbm\src\src\boosting\prediction_early_stop.cpp(86): warning C4715: 'LightGBM::CreatePredictionEarlyStopInstance': not all control paths return a value [C:\Users\James\AppData\Local\Temp\RtmpKw7PIG\R.INSTALL3afce51189c\lightgbm\rc\build_lightgbm.vcxproj]

image

Reproducible example(s)

Rscript build_r.R

Steps to reproduce

  1. Make sure Visual Studio 16 2019 is installed
  2. Make sure Rtools35 is installed and its MinGW is on PATH
  3. run Rscript build_r.R from the root of the repo
@jameslamb jameslamb changed the title [R-package] compiler warning: 'not all control paths return a value' compiler warning: 'not all control paths return a value' May 20, 2020
ChipKerchner pushed a commit to ChipKerchner/LightGBM that referenced this issue Jun 10, 2020
…t#3068)

* [R-package] fix MSVC warning about control paths (fixes microsoft#3067)

* linting

* simplify
ChipKerchner pushed a commit to ChipKerchner/LightGBM that referenced this issue Jun 11, 2020
…t#3068)

* [R-package] fix MSVC warning about control paths (fixes microsoft#3067)

* linting

* simplify
@github-actions
Copy link

This issue 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant