Skip to content

Add alignment wrapper to OS_SockAddr_t#296

Merged
skliper merged 1 commit intonasa:merge-20191230from
jphickey:fix-295-sockaddr-alignment
Dec 30, 2019
Merged

Add alignment wrapper to OS_SockAddr_t#296
skliper merged 1 commit intonasa:merge-20191230from
jphickey:fix-295-sockaddr-alignment

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 pushed 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