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

Errors in linting with tool-cppcheck #39

Closed
mc-hamster opened this issue Apr 14, 2022 · 2 comments · Fixed by #40
Closed

Errors in linting with tool-cppcheck #39

mc-hamster opened this issue Apr 14, 2022 · 2 comments · Fixed by #40

Comments

@mc-hamster
Copy link
Contributor

While integrating the unishox2 library with the Meshtastic project, the initial PR reported the following errors as part of the linting with tool-cppcheck.

I'll submit a PR to fix this shortly.

Tool Manager: Installing platformio/tool-cppcheck @ ~1.260.0
25
Downloading...
26
Unpacking...
27
Tool Manager: tool-cppcheck @ 1.260.0 has been installed!
28
src/mesh/compression/unishox2.c:132: [low:style] Redundant condition: If 'c > 32', the comparison 'c != 0' is always true. [redundantCondition]
29
src/mesh/compression/unishox2.c:150: [low:style] The scope of the variable 'cur_bit' can be reduced. [variableScope]
30
src/mesh/compression/unishox2.c:151: [low:style] The scope of the variable 'blen' can be reduced. [variableScope]
31
src/mesh/compression/unishox2.c:152: [low:style] The scope of the variable 'a_byte' can be reduced. [variableScope]
32
src/mesh/compression/unishox2.c:153: [low:style] The scope of the variable 'oidx' can be reduced. [variableScope]
33
src/mesh/compression/unishox2.c:979: [low:style] Local variable 'idx' shadows outer variable [shadowVariable]

@siara-cc
Copy link
Owner

Hi @mc-hamster , not related to this issue, but you may want to have a look at this:
#47 (comment)
This release (1.0.3) could be used to prevent crashes during decompression due to invalid or garbled inputs that come through unreliable networks.

@mc-hamster
Copy link
Contributor Author

@siara-cc Thanks for the notification. I don't think this will impact us -- we use the highest level of error correction provided by the lora hardware, but will add the upgrade to the backlog regardless.

This is awesome!

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

Successfully merging a pull request may close this issue.

2 participants