Skip to content

Conversation

@pdietl
Copy link
Contributor

@pdietl pdietl commented Dec 16, 2021

No description provided.

This commit fixes warnings by certain packed structs not being aligned
to a 4 byte boundary.

Fixes zephyrproject-rtos#41255

Signed-off-by: Pete Dietl <petedietl@gmail.com>
This commit fixes a strict aliasing rule violation by using
a compiler builtin

Signed-off-by: Pete Dietl <petedietl@gmail.com>
@henrikbrixandersen henrikbrixandersen linked an issue Dec 16, 2021 that may be closed by this pull request
@henrikbrixandersen henrikbrixandersen added the Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc. label Dec 16, 2021
@henrikbrixandersen
Copy link
Member

@carlescufi Please review as you are the author of #40909.

@henrikbrixandersen henrikbrixandersen added the bug The issue is a bug, or the PR is fixing a bug label Dec 16, 2021
for (uint32_t *ptr = (uint32_t *)msg_ram;
ptr < (uint32_t *)msg_ram +
for (uint32_t *ptr = (u32 *)msg_ram;
ptr < (u32 *)msg_ram +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be fixed by #41273 instead of adding __may_alias?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I commented in the pr you referring to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but you still reply on code that uses __may_alias, so it doesn't remove the usage.

@henrikbrixandersen
Copy link
Member

Fixed by #41326. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: CAN bug The issue is a bug, or the PR is fixing a bug Hotfix Fix for issues blocking development, i.e. upstream CI issues, tests failing in upstream CI , etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drivers/can/can_mcan.c: address-of-packed-member warnings

3 participants