Skip to content

Guarantees about struct layout #289

Answered by lattner
lsh asked this question in Q&A
May 30, 2023 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

We haven't discussed this, but I agree with you that an opt-in decorator that specifies layout is the right way to go. It seems good for the compiler to be able to reorder fields (e.g. eliminate internal padding) to allow programmers to not have to worry about this, but people putting bits on a wire or dealing with c compatibility should be able to get that. We will need to properly design this out

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@soraros
Comment options

@tiamiceli
Comment options

Answer selected by lsh
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants