Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-distinct identifiers static analysis warning #115

Closed
2 tasks done
skliper opened this issue Jul 17, 2023 · 1 comment · Fixed by #123
Closed
2 tasks done

Non-distinct identifiers static analysis warning #115

skliper opened this issue Jul 17, 2023 · 1 comment · Fixed by #123

Comments

@skliper
Copy link
Contributor

skliper commented Jul 17, 2023

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
DS_CloseFileCmd conflict here:

DS/fsw/src/ds_cmds.c

Lines 963 to 965 in 2a6c6a2

void DS_CloseFileCmd(const CFE_SB_Buffer_t *BufPtr)
{
const DS_CloseFile_Payload_t *DS_CloseFileCmd;

To Reproduce
Static analysis

Expected behavior
Unique identifiers. TBH calling this variable a Cmd is misleading, it's a pointer to the payload. Suggest changing to PayloadPtr for all of these command processing routines (which would resolve this issue as well).

System observed on:
CodeSonar static analysis

Additional context
None

Reporter Info
Jacob Hageman - NASA/GSFC

@thnkslprpt
Copy link
Contributor

2 more instances in the same file that differ only in case (capitalization):

DS/fsw/src/ds_cmds.c

Lines 1116 to 1118 in 2a6c6a2

void DS_AddMIDCmd(const CFE_SB_Buffer_t *BufPtr)
{
const DS_AddRemoveMid_Payload_t *DS_AddMidCmd;

DS/fsw/src/ds_cmds.c

Lines 1214 to 1216 in 2a6c6a2

void DS_RemoveMIDCmd(const CFE_SB_Buffer_t *BufPtr)
{
const DS_AddRemoveMid_Payload_t *DS_RemoveMidCmd;

PayloadPtr, CommandPtr or CmdPtr seem like the clearest options.

PayloadPtr is currently only used for the HK payload in other apps, whereas CmdPtr seems to be preferred for the other command payload types.

chillfig pushed a commit to chillfig/DS that referenced this issue Jan 23, 2024
dzbaker added a commit that referenced this issue Feb 1, 2024
Fix #115, Adds distinct identifiers from command name
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 a pull request may close this issue.

2 participants