Skip to content

Fix #144, remove overwritten checksum variable assignments - #145

Closed
sylvesterkaczmarek wants to merge 2 commits into
nasa:devfrom
sylvesterkaczmarek:fix-144-remove-dead-stores
Closed

sylvesterkaczmarek wants to merge 2 commits into
nasa:devfrom
sylvesterkaczmarek:fix-144-remove-dead-stores

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #144.

Remove 24 overwritten initializations and assignments across checksum commands, table processing, compute routines, and utilities. Retain initialization required by error paths and checksum accumulation. No API, telemetry, command, or intended runtime behavior changes.

Validation

Debian 12 arm64, GCC 12.2, native cFE/OSAL configuration with EDS disabled:

  • All 11 application coverage targets passed, repeated 20 times: 385 cases and 2,401 assertions per suite run.
  • Cppcheck 2.10 redundant/unread-store findings: 24 before, zero after. Other scope/naming style suggestions are outside this change. CodeSonar/Axle were not available locally.
  • Clang 14 static analysis reported no diagnostics after the change.
  • All 11 optimized flight-source objects are byte-for-byte identical to the baseline with GCC -O2 -g0 -fno-ident; the build also enables uninitialized-variable warnings as errors.
  • Flight application built; changed lines formatted using the cFS configuration; git diff --check passed.

Existing tests are unchanged because this removes dead stores without adding behavior. Full mission/COSMOS and hardware tests were not run.

Contributor: Sylvester Kaczmarek, Personal. No third-party code added. Contributor License Agreement submission status is unverified.

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Applied clang-format 19 with the current cFS configuration to the declarations flagged by CI. Whitespace-only changes; the application coverage targets pass for 20 repetitions, and optimized flight objects remain identical to the pre-format baseline. Awaiting the new CI results.

@myc-yang

Copy link
Copy Markdown

Thank you for your contribution, Sylvester. I wrote issue #144 because we are evaluating various static code analysis tools and then apply its findings to the code. I already have a PR submitted, which I believe incorporates all of the changes in this PR, as well as others. Feel free to review and comment on it if you wish.

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

Thanks for the context. I checked #146 and it includes the changes from this PR as part of the broader static-analysis cleanup, so I’ll close this one to avoid duplicate work. Happy to review or comment on #146 if useful.

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 this pull request may close these issues.

CS files make variable assignments that prove to be useless

4 participants