nasa / nasa/CF

CF Unused type declarations

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

Nobody has claimed this yet.

Dominant language
C
Stars
120
Forks
77
Avg merge
7d 18h
Merged PRs (30d)
3

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

Contributor guide

Open the contributing guide

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.