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

serial: Switch from repr(packed) to repr(C) #35

Closed
wants to merge 1 commit into from
Closed

Conversation

crawfxrd
Copy link
Member

@crawfxrd crawfxrd commented Oct 5, 2023

Is this valid?

Need to address unaligned_refrences to update the toolchain.

warning: lint `unaligned_references` has been removed: converted into hard error, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> for more information

@crawfxrd crawfxrd requested a review from jackpot51 October 9, 2023 14:09
@crawfxrd
Copy link
Member Author

crawfxrd commented Oct 9, 2023

This probably requires making ReadOnly (and other structs in Io) repr(transparent), to ensure all types are the same size (and thus always aligned to T, assuming the struct itself is aligned).

Alternatively, remove the transmute and initialize each field in SerialPort<Mmio<u32>>::new.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
@crawfxrd crawfxrd closed this Nov 13, 2024
@crawfxrd crawfxrd deleted the no-packed branch March 2, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant