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]' #39

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

New Cppcheck errors: '[unreadVariable]' #39

thnkslprpt opened this issue Nov 6, 2022 · 0 comments · Fixed by #40
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 MD:

fsw/src/md_cmds.c:46:40: style: Variable 'Status' is assigned a value that is never used. [unreadVariable]
    int32              Status          = CFE_SUCCESS;
                                       ^
fsw/src/md_cmds.c:49:40: style: Variable 'TableIndex' is assigned a value that is never used. [unreadVariable]
    uint16             TableIndex      = 0;
                                       ^
fsw/src/md_cmds.c:134:40: style: Variable 'Status' is assigned a value that is never used. [unreadVariable]
    int32              Status          = CFE_SUCCESS;
                                       ^
fsw/src/md_cmds.c:138:40: style: Variable 'TableIndex' is assigned a value that is never used. [unreadVariable]
    uint16             TableIndex      = 0;
                                       ^
fsw/src/md_cmds.c:195:44: style: Variable 'Status' is assigned a value that is never used. [unreadVariable]
    int32                   Status         = CFE_SUCCESS;
                                           ^
fsw/src/md_cmds.c:199:44: style: Variable 'DwellEntryPtr' is assigned a value that is never used. [unreadVariable]
    MD_DwellControlEntry_t *DwellEntryPtr  = 0; /* points to local task data */
                                           ^
fsw/src/md_cmds.c:200:44: style: Variable 'EntryIndex' is assigned a value that is never used. [unreadVariable]
    uint16                  EntryIndex     = 0;
                                           ^
fsw/src/md_cmds.c:410:40: style: Variable 'Status' is assigned a value that is never used. [unreadVariable]
    int32                 Status       = CFE_SUCCESS;
                                       ^
fsw/src/md_dwell_pkt.c:40:37: style: Variable 'Result' is assigned a value that is never used. [unreadVariable]
    int32                    Result = 0;
                                    ^
fsw/src/md_dwell_pkt.c:42:48: style: Variable 'EntryIndex' is assigned a value that is never used. [unreadVariable]
    uint16                   EntryIndex        = 0;
                                               ^
fsw/src/md_dwell_pkt.c:43:48: style: Variable 'NumDwellAddresses' is assigned a value that is never used. [unreadVariable]
    uint16                   NumDwellAddresses = 0;
                                               ^
fsw/src/md_dwell_tbl.c:174:27: style: Variable 'Status' is assigned a value that is never used. [unreadVariable]
    int32  Status         = CFE_SUCCESS;
                          ^
fsw/src/md_utils.c:192:21: style: Variable 'OS_Status' is assigned a value that is never used. [unreadVariable]
    int32 OS_Status = OS_SUCCESS;
                    ^
##[error]Process completed with exit code 255.

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

Expected behavior
Cppcheck should pass without raising any errors.

Reporter Info
Avi @thnkslprpt

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

Fix #39, 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