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

Add alignment wrapper to OS_SockAddr_t #296

Merged
merged 1 commit into from
Dec 30, 2019

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Dec 3, 2019

Describe the contribution

Fix #295

Add a union wrapper for the abstract data field such that it will be aligned for 32 bit integer values and/or pointers, whichever is greater.

This removes cast alignment warnings in this code with compiling on CPU architectures with strict alignment requirements.

Testing performed
Build code with full warnings (including -Wcast-align) on both native (x86-64) and MIPS32

Execute CFE on native (x86-64) (with CI_LAB/TO_LAB that use OSAL-provided socket abstraction), confirm no changes in behavior.

Expected behavior changes
No compiler warning. No changes to runtime behavior.

System(s) tested on:
Linux MIPS 32 bit (build)
Ubuntu 18.04 LTS, 64 bit (build + run)

Contributor Info
Joseph Hickey, Vantage Systems, Inc.

Community contributors
You must attach a signed CLA (required for acceptance) or reference one already submitted

Add a union wrapper for the abstract data field such that it will
be aligned for 32 bit integer values and/or pointers, whichever is
greater.

This should be sufficient for casting to the system "struct sockaddr"
@skliper skliper added the CCB:Approved Indicates code review and approval by community CCB label Dec 18, 2019
@skliper skliper added this to the 5.1.0 milestone Dec 18, 2019
@skliper
Copy link
Contributor

skliper commented Dec 18, 2019

CCB 20191218 - Reviewed and approved for IC

@skliper skliper changed the base branch from master to merge-20191230 December 30, 2019 21:02
@skliper skliper merged commit 25b9efd into nasa:merge-20191230 Dec 30, 2019
skliper added a commit that referenced this pull request Dec 30, 2019
Fix #295, #298, #305, #307, #308,
    #313, #314, #316, #321, #323
Reviewed and approved at 2019-12-18 CCB
@jphickey jphickey deleted the fix-295-sockaddr-alignment branch February 13, 2020 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants