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

DataToCopy argument of CFE_ES_CopyToCDS should be "const" #1726

Closed
jphickey opened this issue Jul 29, 2021 · 1 comment · Fixed by #1765 or #1808
Closed

DataToCopy argument of CFE_ES_CopyToCDS should be "const" #1726

jphickey opened this issue Jul 29, 2021 · 1 comment · Fixed by #1765 or #1808
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
This pointer argument is read-only, the data is passed to PSP which is (correctly) a const void*

Describe the solution you'd like
Prototype should be:

CFE_Status_t CFE_ES_CopyToCDS(CFE_ES_CDSHandle_t Handle, const void *DataToCopy)

Additional context
Should not cause any issue for existing code (OK to pass non-const to const, just not the other way). Making const-correct avoids issue/warning if called from an app using const data.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Jul 29, 2021
@jphickey
Copy link
Contributor Author

jphickey commented Aug 5, 2021

Also noted that the SB functions "CFE_SB_TransmitMsg" and "CFE_SB_TransmitMsgValidate" also have a read-only MsgPtr input, these should also be const.

jphickey added a commit to jphickey/cFE that referenced this issue Aug 5, 2021
The following functions have read-only inputs which are passed by
pointer, so it should be "const" qualified:

CFE_ES_CopyToCDS
CFE_SB_TransmitMsg
CFE_SB_TransmitMsgValidate
astrogeco added a commit that referenced this issue Aug 13, 2021
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants