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

sys/net/sock_util: fix dead initialization warning #12595

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Oct 28, 2019

This was reported by LLVM scan build. The value assigned at initialization is never used, so could be removed

Contribution description

This PR fixes a variable dead initialization, reported when using LLVM scan-build. The value assigned during initialization is never used after, because the variable gets another value reassigned before it's actually used.

Testing procedure

  • Run TOOLCHAIN=llvm make -C examples/suit_update scan-build
    on master, there's a warning (among others) about a dead initialization in sock_util.c. With this PR, the warning is gone.

Issues/PRs references

Tick one item in #11852

This was reported by LLVM scan build. The value assigned at initialization is never used, so could be removed
@aabadie aabadie added Area: network Area: Networking Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 28, 2019
@aabadie aabadie requested a review from miri64 October 28, 2019 15:44
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hostend is overwritten on first use.

@benpicco benpicco merged commit 456982f into RIOT-OS:master Oct 28, 2019
@aabadie aabadie deleted the pr/net/sock_util_scan_build branch December 6, 2019 20:34
@fjmolinas fjmolinas added this to the Release 2020.01 milestone Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants