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

Implicit/incorrect OSAL ID type conversion in es_UT.c #2024

Closed
jphickey opened this issue Jan 18, 2022 · 0 comments · Fixed by #2025 or #2019
Closed

Implicit/incorrect OSAL ID type conversion in es_UT.c #2024

jphickey opened this issue Jan 18, 2022 · 0 comments · Fixed by #2025 or #2019
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
The following line in unit tests makes an implicit conversion between OS_OBJECT_ID_UNDEFINED (an osal_id_t) and an integer:

UT_SetDeferredRetcode(UT_KEY(OS_TaskGetId), 1, OS_OBJECT_ID_UNDEFINED);

This is allowed with the current permissive type definition, but fails when building with strict types.

To Reproduce
Use a type-safe definition for osal_id_t. This conversion fails and results in a compiler error.

Expected behavior
Should use OS_ObjectIdToInteger() here - easiest way to make it work without changing logic.

System observed on:
Ubuntu 21.10

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Jan 18, 2022
jphickey added a commit to jphickey/cFE that referenced this issue Jan 18, 2022
Corrects the implicit type conversion from an osal_id_t to an integer,
making it explicit by using the OS_ObjectIdToInteger() conversion function.
@astrogeco astrogeco added this to the Draco milestone Jan 19, 2022
astrogeco added a commit that referenced this issue Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants