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

New Cppcheck errors: '[unreadVariable]' #52

Closed
2 tasks done
thnkslprpt opened this issue Nov 6, 2022 · 0 comments · Fixed by #53
Closed
2 tasks done

New Cppcheck errors: '[unreadVariable]' #52

thnkslprpt opened this issue Nov 6, 2022 · 0 comments · Fixed by #53
Milestone

Comments

@thnkslprpt
Copy link
Contributor

thnkslprpt commented Nov 6, 2022

Checklist

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
Latest version of Cppcheck is issuing the following failures for HS:

fsw/src/hs_cmds.c:157:23: style: Variable 'Status' is assigned a value that is never used. [unreadVariable]
    int32  Status     = CFE_SUCCESS;
                      ^
fsw/src/hs_cmds.c:158:23: style: Variable 'TableIndex' is assigned a value that is never used. [unreadVariable]
    uint32 TableIndex = 0;
                      ^
fsw/src/hs_custom.c:267:22: style: Variable 'j' is assigned a value that is never used. [unreadVariable]
    uint32 j         = 0;
                     ^
fsw/src/hs_custom.c:268:22: style: Variable 'ThisValue' is assigned a value that is never used. [unreadVariable]
    uint32 ThisValue = 0;
                     ^
fsw/src/hs_custom.c:270:28: style: Variable 'Ordinal' is assigned a value that is never used. [unreadVariable]
    uint32 Ordinal         = 0;
                           ^
fsw/src/hs_custom.c:271:28: style: Variable 'NewOrdinalIndex' is assigned a value that is never used. [unreadVariable]
    uint32 NewOrdinalIndex = 0;
                           ^
fsw/src/hs_monitors.c:48:35: style: Variable 'Status' is assigned a value that is never used. [unreadVariable]
    int32            Status       = CFE_SUCCESS;
                                  ^
fsw/src/hs_monitors.c:50:35: style: Variable 'ActionType' is assigned a value that is never used. [unreadVariable]
    uint16           ActionType   = 0;
                                  ^
fsw/src/hs_monitors.c:228:35: style: Variable 'ActionType' is assigned a value that is never used. [unreadVariable]
    uint16           ActionType   = 0;
                                  ^
fsw/src/hs_monitors.c:458:24: style: Variable 'EntryResult' is assigned a value that is never used. [unreadVariable]
    int32  EntryResult = 0;
                       ^
fsw/src/hs_monitors.c:460:23: style: Variable 'ActionType' is assigned a value that is never used. [unreadVariable]
    uint16 ActionType = 0;
                      ^
fsw/src/hs_monitors.c:461:23: style: Variable 'CycleCount' is assigned a value that is never used. [unreadVariable]
    uint16 CycleCount = 0;
                      ^
fsw/src/hs_monitors.c:462:23: style: Variable 'NullTerm' is assigned a value that is never used. [unreadVariable]
    uint16 NullTerm   = 0;
                      ^
fsw/src/hs_monitors.c:549:24: style: Variable 'EntryResult' is assigned a value that is never used. [unreadVariable]
    int32  EntryResult = 0;
                       ^
fsw/src/hs_monitors.c:551:23: style: Variable 'ActionType' is assigned a value that is never used. [unreadVariable]
    uint16 ActionType = 0;
                      ^
fsw/src/hs_monitors.c:552:23: style: Variable 'EventID' is assigned a value that is never used. [unreadVariable]
    uint16 EventID    = 0;
                      ^
fsw/src/hs_monitors.c:553:23: style: Variable 'NullTerm' is assigned a value that is never used. [unreadVariable]
    uint16 NullTerm   = 0;
                      ^
fsw/src/hs_monitors.c:734:24: style: Variable 'EnableState' is assigned a value that is never used. [unreadVariable]
    uint16 EnableState = 0;
                       ^
fsw/src/hs_monitors.c:735:24: style: Variable 'EntryResult' is assigned a value that is never used. [unreadVariable]
    int32  EntryResult = 0;
                       ^
##[error]Process completed with exit code 255.

To Reproduce
Run the current version of Cppcheck on the current main branch HS source code.

Expected behavior
Cppcheck should pass without raising any errors.

Reporter Info
Avi @thnkslprpt

thnkslprpt added a commit to thnkslprpt/HS that referenced this issue Nov 7, 2022
dzbaker added a commit that referenced this issue Jan 12, 2023
…sing-cppcheck-failure

Fix #52, Remove initializations causing Cppcheck errors
@dmknutsen dmknutsen added this to the Draco milestone Jan 18, 2023
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