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

Fix #72, correct use of union type #73

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
Use ISO C standard value conversion, do not rely on platform-dependent union access.

Fixes #72

Testing performed
Build and run all tests, confirm LC_GetSizedWPData() call is still working as expected.

Expected behavior changes
None

System(s) tested on
Debian

Additional context
Assigning (by value) between signed and unsigned values is defined by ISO C and results are specified. In contrast, writing to one union member and reading from another does not have specified results (although on a twos complement machine with typical implementation it happens to produce the same result...)

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Use ISO C standard value conversion, do not rely on platform-dependent
union access.
@dzbaker dzbaker merged commit 3c8a327 into nasa:main Feb 16, 2023
@jphickey jphickey deleted the fix-72-multitype-safety branch February 17, 2023 16:03
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
@chillfig chillfig added the bug label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improper use of unions in LC_GetSizedWPData
4 participants