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

net/nanocoap: fix issues reported by scan-build #12584

Merged
merged 4 commits into from
Oct 30, 2019

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Oct 27, 2019

Contribution description

This PR is fixing all issues reported by scan-build in nanocoap.c.

Testing procedure

  • Run TOOLCHAIN=llvm make -C examples/nanocoap_server/ scan-build
    On master, several warning are raised in nanocoap.c. With this PR, all are fixed.

  • Test the examples/nanocoap_server and verify it still works

Issues/PRs references

Tick one item in #11852

@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 27, 2019
@aabadie aabadie requested review from kaspar030 and bergzand October 27, 2019 11:02
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.

The changes make sense and don't change functionality in the non-error case.
Errors that were previously silently dropped are now properly reported.

@@ -585,7 +585,7 @@ ssize_t coap_opt_get_next(const coap_pkt_t *pkt, coap_optpos_t *opt,
* @param[out] value start of the option value
*
* @return length of option; 0 if the option exists but is empty
* @return -ENOENT if option not found
* @return -ENOENT if option not found or option cannot be parsed
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this rather be a distinct error code? E.g. -EINVAL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Changed.

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Re-ACK

@miri64
Copy link
Member

miri64 commented Oct 28, 2019

Please squash.

@aabadie aabadie force-pushed the pr/net/nanocoap_scan_build branch from 76879c7 to 8b06560 Compare October 30, 2019 16:03
@aabadie
Copy link
Contributor Author

aabadie commented Oct 30, 2019

squashed (better late than never ;) )

@miri64
Copy link
Member

miri64 commented Oct 30, 2019

ACK upholds

@miri64 miri64 merged commit 71ad10a into RIOT-OS:master Oct 30, 2019
@aabadie aabadie deleted the pr/net/nanocoap_scan_build branch December 6, 2019 20:35
@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.

4 participants