-
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
fixed cpplint errors and disable warning only for VS #2888
Conversation
@@ -76,8 +76,10 @@ const int kAlignedSize = 32; | |||
#define SIZE_ALIGNED(t) ((t) + kAlignedSize - 1) / kAlignedSize * kAlignedSize | |||
|
|||
// Refer to https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4127?view=vs-2019 | |||
#pragma warning(disable : 4127) | |||
#ifdef _MSC_VER | |||
#pragma warning(disable : 4127) |
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.
Maybe some other warning disable could use the msc ver?
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.
@guolinke Sorry, didn't get it. Can you please elaborate?
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 means, there are some other #pragma warning(disable : xxxx)
, which are not inside #ifdef _MSC_VER
.
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.
Ah, got it! I thought that the reference to VS in the corresponding comment means that it is actually needed only for VS. Like in
LightGBM/include/LightGBM/utils/openmp_wrapper.h
Lines 68 to 70 in 6b6709b
#ifdef _MSC_VER | |
#pragma warning(disable: 4068) // disable unknown pragma warning | |
#endif |
And I was aware only about that pragma warning
in openmp_wrapper
code. Should I search for others and wrap them as well?
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.
yeah, I remember there are some in c_api.
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.
Done!
Refer to #1990 and #2883.