Skip to content

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:543: Possible cut'n'paste error ? #91222

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

Closed
dcb314 opened this issue May 6, 2024 · 1 comment · Fixed by #94841

Comments

@dcb314
Copy link

dcb314 commented May 6, 2024

Static analyser cppcheck says:

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:543:35: style: Expression is always false because 'else if' condition matches previous condition at line 535. [multiCondition]

Source code is

 if (m_compression_type == CompressionType::LZFSE)
 ...
 else if (m_compression_type == CompressionType::LZFSE)
@llvmbot
Copy link
Member

llvmbot commented May 6, 2024

@llvm/issue-subscribers-lldb

Author: None (dcb314)

Static analyser cppcheck says:

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:543:35: style: Expression is always false because 'else if' condition matches previous condition at line 535. [multiCondition]

Source code is

 if (m_compression_type == CompressionType::LZFSE)
 ...
 else if (m_compression_type == CompressionType::LZFSE)

xgupta added a commit to xgupta/llvm-project that referenced this issue Jun 8, 2024
The `else if` condition for checking `m_compression_type` is redundant as it matches with a previous `if` condition, making the expression always false.
Reported by cppcheck as a possible cut-and-paste error.

Caught by cppcheck -
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:543:35: style: Expression is always false because 'else if' condition matches previous condition at line 535. [multiCondition]

Fix llvm#91222
xgupta added a commit that referenced this issue Jun 10, 2024
The `else if` condition for checking `m_compression_type` is redundant
as it matches with a previous `if` condition, making the expression
always false. Reported by cppcheck as a possible cut-and-paste error.

Caught by cppcheck -

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:543:35:
style: Expression is always false because 'else if' condition matches
previous condition at line 535. [multiCondition]

Fix #91222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants