Skip to content

Conversation

maribu
Copy link
Member

@maribu maribu commented Sep 5, 2020

Contribution description

As the title says. This is useful to detect issues when doing things like

uint8_t foo[4];
uint32_t *bar = (uint32_t *)foo;
*bar = 0xacdcacdc;

Because in the above example foo has an alignment requirement of 1 byte, but bar has (on most 32 bit archs) an alignment requirement of 4 bytes. Unaligned writes will (depending on architecture) either result faults, writes to the next aligned address instead (usually rounded always down), or slow performance (and writes no longer being atomically).

Testing procedure

Green Murdock.

Issues/PRs references

Depends on:

@maribu maribu added Area: build system Area: Build system Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Sep 5, 2020
@maribu
Copy link
Member Author

maribu commented Sep 5, 2020

Let's see how many issues this uncovers.

@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 5, 2020
@maribu
Copy link
Member Author

maribu commented Sep 6, 2020

Let's see how many issues this uncovers.

Oh oh :-( Sounds like some nights of bug fixing.

@fjmolinas
Copy link
Contributor

How many of these are there? Do we need to enable them gradually?

@maribu
Copy link
Member Author

maribu commented Sep 21, 2020

I'm now back from parental leave. So be prepared for a bunch of bugfix PRs addressing the issues unveiled by this PR ;-)

I hope to have RIOT's code base cleaned up by the end of the week. So I think we don't need to enable this gradually. Maybe there are only just a few issues - but in very central places -, resulting in the high number of build failures.

@maribu maribu removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 22, 2020
@maribu maribu force-pushed the cflags-cast-align branch 2 times, most recently from 9eb8806 to cf09a1c Compare September 28, 2020 08:45
@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 28, 2020
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 17, 2020
@maribu maribu force-pushed the cflags-cast-align branch from ef757be to 2145ca0 Compare December 3, 2021 09:25
@maribu maribu force-pushed the cflags-cast-align branch from 2145ca0 to 63b54b5 Compare December 3, 2021 13:22
@fjmolinas fjmolinas merged commit 3afa47d into RIOT-OS:master Dec 3, 2021
@maribu
Copy link
Member Author

maribu commented Dec 3, 2021

Thanks for the review!

@maribu maribu deleted the cflags-cast-align branch December 3, 2021 16:55
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BLE Area: Bluetooth Low Energy support Area: boards Area: Board ports Area: build system Area: Build system Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Area: tests Area: tests and testing framework Area: USB Area: Universal Serial Bus CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants