-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Fix latent compiler warnings #1775
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
[lldb] Fix latent compiler warnings #1775
Conversation
return swift_flags; | ||
LLVM_FALLTHROUGH; |
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.
Most of the case
s in this switch use a fallthrough. Adrian do you know if it's correct for this one to be a return, not a fall through?
if ((m_return_valobj_sp = SwiftLanguageRuntime::CalculateErrorValue( | ||
frame_sp, persistent_variable_name))) { |
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.
Another case of assignment inside an if
. This one looks like it should be assignment, not equality.
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.
Is the problem here that it's not a declaration? I.e., would if (auto m_return_valobj_sp = SwiftLa...)
trigger a warning?
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.
Correct, a declaration would not trigger the warning. I don't know the history, but it seems clang uses additional parenthesis as a way of saying "this assignment inside an if
is intentional". I see there are a number of uses of this pattern in swift and llvm.
@swift-ci test |
@swift-ci test |
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.
This is good stuff. I think that in the future, it would be useful to create one commit per warning — but we can keep this one as is.
if ((m_return_valobj_sp = SwiftLanguageRuntime::CalculateErrorValue( | ||
frame_sp, persistent_variable_name))) { |
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.
Is the problem here that it's not a declaration? I.e., would if (auto m_return_valobj_sp = SwiftLa...)
trigger a warning?
I'll remember that for next time. Hopefully there won't be a next time, once https://reviews.llvm.org/D87243 is accepted we'll see warnings during development and hopefully they get fixed before committing. |
@swift-ci test Linux platform |
This fixes warnings identified using the
LLVM_ENABLE_WARNINGS
fix in https://reviews.llvm.org/D87243.This is a follow up to the removal of unused code in #1749.