You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The osal_id_t type is currently just a plain uint32 to make it backward-compatible. The problem is that a plain number does not convey the purpose/intent of this ID value. Users can still do things like addition, subtraction, or interchange with other numbers, which are all invalid for a number being used as an ID.
As long as users are using the osal_id_t type and the associated checks/conversions also provided by OSAL (e.g. OS_ObjectIdDefined, etc) then this should be transparent.
Describe the solution you'd like
Make osal_id_t type-safe
Additional context
This was the intent all along with creating a separate osal_id_t typedef and using it across the CFE and PSP.
It does depend on having all the dependent code using the typedef, so probably want to stage this in using OSAL_OMIT_DEPRECATED flag or similar, so we can find the things that are still broken in this regard.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Modifies the osal_id_t typedef to be a non-integer value. The intent
is to catch cases where it inappropriately being used as an integer value.
This is transparent so long as the osal_id_t typedef and provided check
and conversion routines are used.
Is your feature request related to a problem? Please describe.
The
osal_id_t
type is currently just a plainuint32
to make it backward-compatible. The problem is that a plain number does not convey the purpose/intent of this ID value. Users can still do things like addition, subtraction, or interchange with other numbers, which are all invalid for a number being used as an ID.As long as users are using the
osal_id_t
type and the associated checks/conversions also provided by OSAL (e.g. OS_ObjectIdDefined, etc) then this should be transparent.Describe the solution you'd like
Make
osal_id_t
type-safeAdditional context
This was the intent all along with creating a separate
osal_id_t
typedef and using it across the CFE and PSP.It does depend on having all the dependent code using the typedef, so probably want to stage this in using OSAL_OMIT_DEPRECATED flag or similar, so we can find the things that are still broken in this regard.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: