Skip to content

Add typedef for OSAL status codes #1108

@jphickey

Description

@jphickey

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 bare int32 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 to int32) and prototypes of functions returning a status value should be updated to OS_Status_t to more clearly indicate when the return value should be compared against the set of constants defined in osapi-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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions