-
Notifications
You must be signed in to change notification settings - Fork 219
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
Add typedef for OSAL status codes #1108
Labels
Comments
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Jul 20, 2021
Minimal change to add a typedef for OS_Status_t, a macro for constants/literals, and an inline function to convert to "long" for printing/logging.
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Jul 20, 2021
Minimal change to add a typedef for OS_Status_t, a macro for constants/literals, and an inline function to convert to "long" for printing/logging.
astrogeco
added a commit
to astrogeco/osal
that referenced
this issue
Nov 3, 2021
Partial nasa#1108, add typedef for OSAL status codes
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Aug 10, 2022
Move all functions, macros, types, and other definitions related to resource IDs and generic resource management into a separate module, like CFE MSG and SBR, etc. Notably this allows a mission to elect "strict" implementations of these objects, where every ID type is unique, and assigning between them (or uint32) results in a compiler error.
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Aug 10, 2022
Remove code blocks that were commented out, not needed.
jphickey
added a commit
to jphickey/osal
that referenced
this issue
Aug 10, 2022
Fix nasa#1108, split resource id functions into module
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
In the recent versions of CFE, a typedef (
CFE_Status_t
) is added and used for the return type on any function that returns a CFE status code, while OSAL continues to use a bareint32
return type.Although the type does need to be integer in nature (to maintain semantics of equality checks, etc), the typedef does still serve a useful purpose, in that it implies behavioral characteristics of the function i.e. that its return value should be checked against the set of defined status values for that module where certain values have defined meaning - as opposed to a generic number.
Describe the solution you'd like
OSAL should define an
OS_Status_t
(which can be a typedef toint32
) and prototypes of functions returning a status value should be updated toOS_Status_t
to more clearly indicate when the return value should be compared against the set of constants defined inosapi-error.h
.Describe alternatives you've considered
Leave as
int32
(inconsistent with CFE).Additional context
In particular, having a separate type and macros helps identify cases where improper or incomplete type conversions are done, for instance see nasa/cFE#1599
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: