Skip to content
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

useless set of variable is_device_path #19

Closed
AngeloFrangione opened this issue Jan 18, 2021 · 2 comments
Closed

useless set of variable is_device_path #19

AngeloFrangione opened this issue Jan 18, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@AngeloFrangione
Copy link
Contributor

AngeloFrangione commented Jan 18, 2021

Hi!

I'm using cwalk in my project and i use the clang static analyzer tool for scanning my code and it scans cwalk too.
And he finds an useless set of a variable in the code since multiple commits.

../../../subprojects/cwalk/src/cwalk.c:471:3: warning: Value stored to 'is_device_path' is never read
  is_device_path = false;
  ^                ~~~~~

That means it is useless to define it to false in the present code. Because you set it to anything else before using it.
Do you intend to use it in the future ?
It's nice that it's the only problem found by this tool, usually there are a ton !

@AngeloFrangione AngeloFrangione changed the title Unused variable is_device_path useless set of variable is_device_path Jan 18, 2021
@likle likle self-assigned this Jan 18, 2021
@likle likle added the bug Something isn't working label Jan 18, 2021
@likle
Copy link
Owner

likle commented Jan 18, 2021

Hi @AngeloFrangione ! Thanks for submitting this issue. This assignment statement was there to ensure initialization, but you are right - it is not required. I removed it in ddb4388 on the master branch. Please let me know if you encounter more issues!

@AngeloFrangione
Copy link
Contributor Author

It should be fine now ! Thank you!

@likle likle closed this as completed Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants