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

[SOL] Set 32 bits for SBF minimum enum size #90

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

LucasSte
Copy link
Collaborator

@LucasSte LucasSte commented Feb 23, 2024

When using #[repr(C] on an enum in Rust, its size used to be 32-bits. However, rust-lang#107592 changed it to the target's c_int size, which is 64-bits for SBF.

As a consequence, the enum size is inconsistent between versions of the platform tools. A #[repr(C)] enum was 4 bytes in v1.37 and became 8 bytes in v1.39. This PR sets the enum size for 32-bits in SBF, as it used to be before the change.

@LucasSte LucasSte changed the title Set 32 bits for SBF enums size [SOL] Set 32 bits for SBF enums size Feb 23, 2024
@LucasSte LucasSte changed the title [SOL] Set 32 bits for SBF enums size [SOL] Set 32 bits for SBF enum size Feb 23, 2024
@LucasSte LucasSte changed the title [SOL] Set 32 bits for SBF enum size [SOL] Set 32 bits for SBF minimum enum size Feb 23, 2024
@LucasSte LucasSte merged commit 6cc5efc into anza-xyz:solana-1.75.0 Feb 26, 2024
13 checks passed
@LucasSte LucasSte deleted the enum-repr branch February 26, 2024 12:32
LucasSte added a commit to LucasSte/rust that referenced this pull request Jul 10, 2024
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.

2 participants