nasa / osal

The Core Flight System (cFS) Operating System Abstraction Layer (OSAL)
Apache License 2.0
545 stars 213 forks source link

stricter cppcheck #301

Closed avan989 closed 4 years ago

avan989 commented 4 years ago

Is your feature request related to a problem? Please describe. Resolve the follow cppcheck.

[osal/src/bsp/mcf5235-rtems/src/bsp_start.c:136] -> [osal/src/bsp/mcf5235-rtems/src/bsp_start.c:143]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/bsp/mcf5235-rtems/src/bsp_start.c:143] -> [osal/src/bsp/mcf5235-rtems/src/bsp_start.c:144]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/bsp/mcf5235-rtems/src/bsp_start.c:144] -> [osal/src/bsp/mcf5235-rtems/src/bsp_start.c:145]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/bsp/mcf5235-rtems/src/bsp_start.c:145]: (style) Variable 'status' is assigned a value that is never used.
[osal/src/bsp/sis-rtems/src/bsp_start.c:135] -> [osal/src/bsp/sis-rtems/src/bsp_start.c:142]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/bsp/sis-rtems/src/bsp_start.c:142] -> [osal/src/bsp/sis-rtems/src/bsp_start.c:143]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/bsp/sis-rtems/src/bsp_start.c:143] -> [osal/src/bsp/sis-rtems/src/bsp_start.c:144]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/bsp/sis-rtems/src/bsp_start.c:144]: (style) Variable 'status' is assigned a value that is never used.
[osal/src/bsp/sparc-vxworks6.7/ut-src/bsp_ut.c:50]: (style) Unused variable: mode
[osal/src/bsp/sparc-vxworks6.7/ut-src/bsp_ut.c:216]: (style) Variable 'status' is assigned a value that is never used.
[osal/src/os/portable/os-impl-posix-dl.c:54]: (style) struct member 'OS_impl_module_internal_record_t::dl_handle' is never used.
[osal/src/os/posix/os-posix.h:110] -> [osal/src/os/posix/osapi.c:737]: (style, inconclusive) Function 'OS_Posix_InternalTaskCreate_Impl' argument 1 names different: declaration 'thr' definition 'pthr'.
[osal/src/os/posix/os-posix.h:110] -> [osal/src/os/posix/osapi.c:737]: (style, inconclusive) Function 'OS_Posix_InternalTaskCreate_Impl' argument 4 names different: declaration 'Entry' definition 'entry'.
[osal/src/os/posix/osapi.c:163] -> [osal/src/os/posix/osapi.c:2264]: (style, inconclusive) Function 'OS_CompAbsDelayTime' argument 1 names different: declaration 'milli_second' definition 'msecs'.
[osal/src/os/rtems/osloader.c:43]: (style) struct member 'OS_impl_module_internal_record_t::dl_handle' is never used.
[osal/src/tests/mutex-test/mutex-test.c:46] -> [osal/src/tests/mutex-test/mutex-test.c:47]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/tests/mutex-test/mutex-test.c:98] -> [osal/src/tests/mutex-test/mutex-test.c:100]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/tests/mutex-test/mutex-test.c:153] -> [osal/src/tests/mutex-test/mutex-test.c:154]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:65] -> [osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:67]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:79] -> [osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:81]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:94] -> [osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:96]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:108] -> [osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:110]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:122] -> [osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:124]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:137] -> [osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:141]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:161] -> [osal/src/unit-test-coverage/shared/src/coveragetest-binsem.c:172]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:65] -> [osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:67]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:79] -> [osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:81]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:94] -> [osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:96]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:108] -> [osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:110]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:123] -> [osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:127]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:149] -> [osal/src/unit-test-coverage/shared/src/coveragetest-countsem.c:160]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-file.c:253] -> [osal/src/unit-test-coverage/shared/src/coveragetest-file.c:258]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-file.c:336] -> [osal/src/unit-test-coverage/shared/src/coveragetest-file.c:347]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:71] -> [osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:73]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:118] -> [osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:120]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:149] -> [osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:151]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:268] -> [osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:277]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:306] -> [osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:316]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:414] -> [osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:417]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:451] -> [osal/src/unit-test-coverage/shared/src/coveragetest-filesys.c:458]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:274] -> [osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:278]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:347] -> [osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:355]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:348] -> [osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:356]: (style) Variable 'expected' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:551] -> [osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:555]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:591] -> [osal/src/unit-test-coverage/shared/src/coveragetest-idmap.c:598]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-module.c:167]: (style) Boolean result is used in bitwise operation. Clarify expression with parentheses.
[osal/src/unit-test-coverage/shared/src/coveragetest-module.c:102] -> [osal/src/unit-test-coverage/shared/src/coveragetest-module.c:104]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-module.c:116] -> [osal/src/unit-test-coverage/shared/src/coveragetest-module.c:120]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-module.c:160] -> [osal/src/unit-test-coverage/shared/src/coveragetest-module.c:164]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-module.c:189] -> [osal/src/unit-test-coverage/shared/src/coveragetest-module.c:191]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-module.c:219] -> [osal/src/unit-test-coverage/shared/src/coveragetest-module.c:231]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:64] -> [osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:66]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:78] -> [osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:80]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:93] -> [osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:95]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:107] -> [osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:111]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:132] -> [osal/src/unit-test-coverage/shared/src/coveragetest-mutex.c:143]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-network.c:39] -> [osal/src/unit-test-coverage/shared/src/coveragetest-network.c:41]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:70] -> [osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:72]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:84] -> [osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:88]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:111] -> [osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:114]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:133] -> [osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:137]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:160] -> [osal/src/unit-test-coverage/shared/src/coveragetest-queue.c:171]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-select.c:69] -> [osal/src/unit-test-coverage/shared/src/coveragetest-select.c:73]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:98] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:103]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:141] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:152]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:199] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:210]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:252] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:261]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:300] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:309]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:339] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:343]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:371] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:382]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:409] -> [osal/src/unit-test-coverage/shared/src/coveragetest-sockets.c:412]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-task.c:122] -> [osal/src/unit-test-coverage/shared/src/coveragetest-task.c:126]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-task.c:216] -> [osal/src/unit-test-coverage/shared/src/coveragetest-task.c:220]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-task.c:240] -> [osal/src/unit-test-coverage/shared/src/coveragetest-task.c:253]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-task.c:278] -> [osal/src/unit-test-coverage/shared/src/coveragetest-task.c:281]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-time.c:237] -> [osal/src/unit-test-coverage/shared/src/coveragetest-time.c:241]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-time.c:273] -> [osal/src/unit-test-coverage/shared/src/coveragetest-time.c:287]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-timebase.c:147] -> [osal/src/unit-test-coverage/shared/src/coveragetest-timebase.c:151]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-timebase.c:180] -> [osal/src/unit-test-coverage/shared/src/coveragetest-timebase.c:194]: (style) Variable 'actual' is reassigned a value before the old one has been used.
[osal/src/unit-test-coverage/shared/src/coveragetest-timebase.c:248] -> [osal/src/unit-test-coverage/shared/src/coveragetest-timebase.c:267]: (style) Variable 'fake_record.active_id' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osfile-test/ut_osfile_test.c:62] -> [osal/src/unit-tests/osfile-test/ut_osfile_test.c:64]: (style) Variable 'res' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osfile-test/ut_osfile_test_arinc653.c:70] -> [osal/src/unit-tests/osfile-test/ut_osfile_test_arinc653.c:73]: (style) Variable 'res' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osloader-test/ut_module.c:5]: (style) Variable 'i' is assigned a value that is never used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:92]: (warning) %d in format string (no. 4) requires 'int' but the argument type is 'signed long'.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:92]: (warning) %d in format string (no. 6) requires 'int' but the argument type is 'unsigned int'.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:92]: (warning) %d in format string (no. 8) requires 'int' but the argument type is 'unsigned int'.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:105]: (warning) %d in format string (no. 4) requires 'int' but the argument type is 'signed long'.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:105]: (warning) %d in format string (no. 6) requires 'int' but the argument type is 'unsigned int'.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:105]: (warning) %d in format string (no. 8) requires 'int' but the argument type is 'unsigned int'.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:153] -> [osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:170]: (style) Variable 'test_int' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:154] -> [osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:171]: (style) Variable 'test_long' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:155] -> [osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:172]: (style) Variable 'test_unsigned' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:156] -> [osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:173]: (style) Variable 'test_hex' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:159] -> [osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:176]: (style) Variable 'test_char' is reassigned a value before the old one has been used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:170]: (style) Variable 'test_int' is assigned a value that is never used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:171]: (style) Variable 'test_long' is assigned a value that is never used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:172]: (style) Variable 'test_unsigned' is assigned a value that is never used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:173]: (style) Variable 'test_hex' is assigned a value that is never used.
[osal/src/unit-tests/osprintf-test/ut_osprintf_misc.c:176]: (style) Variable 'test_char' is assigned a value that is never used.
[osal/src/unit-tests/shared/ut_os_stubs.c:116] -> [osal/src/unit-tests/shared/ut_os_stubs.c:120]: (style) Variable 'apiInfo' is reassigned a value before the old one has been used.
[osal/src/unit-tests/shared/ut_os_stubs.h:171] -> [osal/src/unit-tests/shared/ut_os_stubs.c:159]: (style, inconclusive) Function 'UT_os_set_log_verbose' argument 1 names different: declaration 'verboseLevel' definition 'vLevel'.
[osal/src/ut-stubs/osapi-utstub-file.c:108] -> [osal/src/ut-stubs/osapi-utstub-file.c:110]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-file.c:147] -> [osal/src/ut-stubs/osapi-utstub-file.c:149]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-mutex.c:127] -> [osal/src/ut-stubs/osapi-utstub-mutex.c:129]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-mutex.c:156] -> [osal/src/ut-stubs/osapi-utstub-mutex.c:158]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-queue.c:102] -> [osal/src/ut-stubs/osapi-utstub-queue.c:104]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-queue.c:145] -> [osal/src/ut-stubs/osapi-utstub-queue.c:147]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-queue.c:186] -> [osal/src/ut-stubs/osapi-utstub-queue.c:188]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-task.c:157] -> [osal/src/ut-stubs/osapi-utstub-task.c:159]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/osapi-utstub-task.c:182] -> [osal/src/ut-stubs/osapi-utstub-task.c:184]: (style) Variable 'status' is reassigned a value before the old one has been used.
[osal/src/ut-stubs/utstub-helpers.c:194]: (style) Variable 'InUse' is modified but its new value is never used.

Describe the solution you'd like Resolve cppcheck warning

Requester Info Anh Van, NASA Goddard

skliper commented 4 years ago

This was split