-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[c_api] Improve ANSI compatibility by avoiding <stdbool.h> #4697
Conversation
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.
LGTM, thanks a lot for your contribution!
Shall we change the call of LGBM_BoosterGetLinear in LightGBM/python-package/lightgbm/basic.py Lines 3569 to 3572 in dc02dca
Since _Bool may have smaller size than int , it seems that we can wrongly set some unallocated bytes when calling LGBM_BoosterGetLinear .
|
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.
Shall we change the call of LGBM_BoosterGetLinear in
basic.py
?
Ah, indeed, we definitely should! Sorry, I missed this one call of LGBM_BoosterGetLinear
across the whole LightGBM codebase.
@drewmiller Could you please update the linked Python code or do you need any help with it?
Kindly ping @drewmiller |
Apologies for the delay. Will make the change this weekend. |
No problem, please take your time. I just wanted to make sure you didn't forget about this PR. |
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.
Thanks @drewmiller !
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. |
Mentioned in #4609, these edits improve ANSI C compatibility by removing reliance on stdbool.h. These edits may cause a compiler warning for existing code which passes a
_Bool
pointer asout
. However, given the brief tenure of ANSI C compatibility, it seems unlikely there will be much breakage.