-
Notifications
You must be signed in to change notification settings - Fork 278
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
Fix compilation with -Wunused-variable #1714
Conversation
Don't think this'll fly w/ MSVC, right? Inserting Then again, looks like |
Good point, |
When compiling with -Wunused-variable, `EXT_STRERROR_R_CHAR_P` gets undefined because of a failing compilation check. An alternative would be to mark `c` as `__attribute__((undefined))`, but MSVC doesn't have `__attribute__((undefined))`.
PTAL. |
Codecov Report
@@ Coverage Diff @@
## main #1714 +/- ##
=======================================
Coverage 66.89% 66.89%
=======================================
Files 151 151
Lines 20761 20761
=======================================
Hits 13889 13889
Misses 6872 6872 Continue to review full report at Codecov.
|
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 for the contribution! 👍
@Mergifyio backport 0.27-maintenance |
Command
|
When compiling with
-Wunused-variable
,EXT_STRERROR_R_CHAR_P
gets undefined because of a failing compilation check.An alternative would be to
return c ? 0 : 0
, which works with compilers that do not have__attribute__((undefined))
, but recent compilers seem to support this and the__attribute__
approach seems cleaner.