nasa / MD

The Core Flight System (cFS) Memory Dwell (MD) application.
Apache License 2.0
25 stars 18 forks source link

New Cppcheck errors: '[unreadVariable]' #39

Closed thnkslprpt closed 1 year ago

thnkslprpt commented 2 years ago

Checklist

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