Y
Hacker News
new
|
ask
|
show
|
jobs
by
afdbcreid
19 days ago
E.g. you cannot translate `#[repr(C)] struct Foo { v: i32, u: i32 }` to `typedef struct { int32_t v; int32_t u; } Foo;` because in Rust it's entirely valid to take a `&Foo` and view it as `&[i32; 2]`, while in C this is UB.
1 comments
1718627440
18 days ago
Isn't the alignment for the struct and the array the same, because it is determined by the inner type?
link