-
Notifications
You must be signed in to change notification settings - Fork 204
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
Stack pointer parameter to CFE_ES_CreateChildTask should not be marked "const" #51
Comments
Imported from trac issue 20. Created by jphickey on 2015-01-15T11:56:22, last modified: 2019-03-05T14:57:55 |
Trac comment by jphickey on 2015-01-15 12:15:37: Pushed branch "trac-20-non_const_stack", commit [changeset:84ca19d] to address this. The only risk with merging this fix is if some apps that are calling this function are explicitly/needlessly making the pointer passed in as "const" just because the prototype was that way. Most use cases actually pass a NULL here which will not be a problem. This will not break compatibility with older OSAL version, but it IS required before the OSAL prototype can be fixed. |
Trac comment by jphickey on 2015-04-06 11:34:14: This is ready for review/merge |
Trac comment by sstrege on 2015-04-06 14:22:42: Concur with change/merge |
Trac comment by acudmore on 2015-04-07 09:23:30: Concur. The OSs that allow you to specify a stack address do not use const, so it makes sense to be consistent. |
Trac comment by glimes on 2015-04-07 12:59:09: Tested changeset [changeset:84ca19d6] as part of the ic-2015-03-10 merge. |
Trac comment by glimes on 2015-04-13 15:30:48: Part of integration candidate 2015-03-10, |
Trac comment by glimes on 2016-02-25 10:17:32: these will be fixed in CFE 6.5 |
Trac comment by jhageman on 2019-03-05 14:57:55: Milestone renamed |
By definition, a task's stack memory must be writeable. The stack pointer parameter to CFE_ES_CreateChildTask() is qualified as "const". Although this matches OSAL's Task API, OSAL is wrong too and should be fixed.
See: [https://babelfish.arc.nasa.gov/trac/cfs_osal/ticket/13]
This ticket should be merged into CFE before the OSAL ticket is fixed.
This change will not affect compatibility with prior versions of OSAL because it is OK to pass a non-const pointer for a const parameter (but vice-versa is an error).
The text was updated successfully, but these errors were encountered: