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

Cast vs mask to alter value in CFE_MSG_SetMsgId v1 - static analysis warning #1204

Closed
skliper opened this issue Mar 3, 2021 · 0 comments · Fixed by #1231 or #1243
Closed

Cast vs mask to alter value in CFE_MSG_SetMsgId v1 - static analysis warning #1204

skliper opened this issue Mar 3, 2021 · 0 comments · Fixed by #1231 or #1243
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Mar 3, 2021

Is your feature request related to a problem? Please describe.
In current implementation of CFE_MSG_SetMsgId for v1 uses a cast to alter a value:

MsgPtr->CCSDS.Pri.StreamId[0] = (uint8)(msgidval >> 8);
MsgPtr->CCSDS.Pri.StreamId[1] = (uint8)(msgidval);

Describe the solution you'd like
Probably more obvious to mask, which would squash static analysis warnings

Describe alternatives you've considered
Leave as-is

Additional context
Static analysis warning, cast alters value

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the 7.0.0 milestone Mar 3, 2021
@skliper skliper self-assigned this Mar 3, 2021
skliper added a commit to skliper/cFE that referenced this issue Mar 16, 2021
skliper added a commit to skliper/cFE that referenced this issue Mar 17, 2021
astrogeco added a commit that referenced this issue Mar 18, 2021
Fix #1204, Use mask instead of cast to alter value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant