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

Do not rely on OSAL SOFTWARE_(BIG|LITTLE)_BIT_ORDER #1217

Closed
jphickey opened this issue Mar 10, 2021 · 1 comment · Fixed by #1218 or #1243
Closed

Do not rely on OSAL SOFTWARE_(BIG|LITTLE)_BIT_ORDER #1217

jphickey opened this issue Mar 10, 2021 · 1 comment · Fixed by #1218 or #1243
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
These endian-indicator macros are problematic for many reasons as documented in nasa/osal#843. The continued presence of these macros in OSAL came up again in a recent code review.

OSAL will likely stop providing these macros in the next version, because nothing in OSAL is endian-dependent.

CFE only uses these to implement CFE_MAKE_BIG16 / CFE_MAKE_BIG32 macros.

Describe the solution you'd like
Move the nonstandard logic from OSAL into CFE, because nothing in OSAL depends on it.

For backward compatibility CFE will likely still have to provide this macro for historical reasons, in case some apps use it, and because TIME uses those CFE_MAKE_BIG* macros.

Additional context
See nasa/osal#843

In CFE the logic should be put in a separate header where it can be confined/limited to the scopes where this is actually used/needed, rather than a ubiquitous header like common_types.h. This way an #error directive if the check was inconclusive will make more sense since it won't error out on cases where we don't care (i.e. most).

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@skliper
Copy link
Contributor

skliper commented Mar 10, 2021

Could be part of #1209

@skliper skliper added this to the 7.0.0 milestone Mar 10, 2021
jphickey added a commit to jphickey/cFE that referenced this issue Mar 10, 2021
In a future version OSAL "common_types.h" will no longer provide
the bit/byte order macros.

This puts the same determination logic directly in cfe_endian.h.

Same basic issues still present, just now confined to CFE, and put
in a localized header that should be only used by code with an
actual endianness dependency, rather than a ubiquitous header
that is used everywhere.
jphickey added a commit to jphickey/cFE that referenced this issue Mar 16, 2021
In a future version OSAL "common_types.h" will no longer provide
the bit/byte order macros.

This puts the same determination logic directly in cfe_endian.h.

Same basic issues still present, just now confined to CFE, and put
in a localized header that should be only used by code with an
actual endianness dependency, rather than a ubiquitous header
that is used everywhere.
jphickey added a commit to jphickey/cFE that referenced this issue Mar 16, 2021
In a future version OSAL "common_types.h" will no longer provide
the bit/byte order macros.

This puts the same determination logic directly in cfe_endian.h.

Same basic issues still present, just now confined to CFE, and put
in a localized header that should be only used by code with an
actual endianness dependency, rather than a ubiquitous header
that is used everywhere.
astrogeco added a commit that referenced this issue Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants