CF Unused type declarations

Open
#522 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
embedded-iot

Research direction

Start with the five locations listed in config/default_cf_msgdefs.h, fsw/src/cf_utils.c, fsw/src/cf_cfdp_dispatch.h, and fsw/src/cf_cfdp_types.h, then run the project's static analysis tools. Check each reported typedef against its scope and remove or otherwise address only the unused type declarations. Done means the listed MISRA2012:2.3 findings are resolved without introducing new analysis issues.

Written by the indexing model from the issue text.

Description

Checklist (Please check before submitting)

  • 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
The static code analysis tools found several instances where a typedef statement defines a type that is not used anywhere in the scope of the typedef.

To Reproduce
Run static analysis tools.

Expected behavior
Code should adhere to Misra2012:2.3: A project should not contain unused type declarations.

Code snips
https://github.com/nasa/CF/blob/6b2ebd22bcf017bd0aabc7428efda5b36719e743/config/default_cf_msgdefs.h#L45
https://github.com/nasa/CF/blob/6b2ebd22bcf017bd0aabc7428efda5b36719e743/fsw/src/cf_utils.c#L45
https://github.com/nasa/CF/blob/6b2ebd22bcf017bd0aabc7428efda5b36719e743/fsw/src/cf_cfdp_dispatch.h#L41
https://github.com/nasa/CF/blob/6b2ebd22bcf017bd0aabc7428efda5b36719e743/fsw/src/cf_cfdp_dispatch.h#L65
https://github.com/nasa/CF/blob/6b2ebd22bcf017bd0aabc7428efda5b36719e743/fsw/src/cf_cfdp_types.h#L384

System observed on:

  • Hardware: PC
  • OS: Linux

Additional context
N/A

Reporter Info
José Lombay-González / NASA GRC

Dominant language
C
Stars
123
Forks
82
Avg merge
2d 22h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nasa/CF

All issues in nasa/CF

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.