Skip to content

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 6, 2021

Contribution description

Align the first member of struct sockaddr and struct sockaddr_storage as uint32_t to elevate the alignment of the structure to level of uint32_t. This is needed as struct sockaddr_in uses an uint32_t to store the IPv4 address, previously resulting in struct sockaddr_in currently having a greater alignment requirement that struct sockaddr_storage.

POSIX sockets should still work, and now do so reliably on platforms that do not support unaligned memory accesses.

Issues/PRs references

Split out of #14955

This contains the same commit to enable C11 for MIPS as #17195 - so if one of the two gets in first the other should be rebased on master.

@github-actions github-actions bot added the Area: sys Area: System label Nov 6, 2021
@maribu maribu added Area: POSIX Area: POSIX API wrapper CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) and removed Area: sys Area: System labels Nov 6, 2021
@github-actions github-actions bot added the Area: sys Area: System label Nov 10, 2021
This brings MIPS back in line with the other archs.
RIOT switched to C11, so packages need to follow suit to use RIOT's
headers.
Align the first member of `struct sockaddr` and
`struct sockaddr_storage` as `uint32_t` to elevate the alignment of the
structure to level of `uint32_t`. This is needed as
`struct sockaddr_in` uses an `uint32_t` to store the IPv4 address,
previously resulting in `struct sockaddr_in` currently having a greater
alignment requirement that `struct sockaddr_storage`.
@github-actions github-actions bot added Area: build system Area: Build system Area: pkg Area: External package ports Platform: MIPS Platform: This PR/issue effects MIPS-based platforms labels Nov 11, 2021
@maribu
Copy link
Member Author

maribu commented Nov 11, 2021

Added two commits to enable use of C11 for MIPS and for pkg/ccn-lite. I reordered the commits to ease bisecting.

@chrysn chrysn merged commit 69dadf6 into RIOT-OS:master Nov 16, 2021
@maribu maribu deleted the sys/posix/sockets branch November 16, 2021 13:01
@maribu
Copy link
Member Author

maribu commented Nov 16, 2021

thanks!

@fjmolinas fjmolinas added this to the Release 2022.01 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: pkg Area: External package ports Area: POSIX Area: POSIX API wrapper Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: MIPS Platform: This PR/issue effects MIPS-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants