immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.91k stars 229 forks source link

analyze: avoid rewriting structs mentioned in extern declarations #948

Closed spernsteiner closed 1 year ago

spernsteiner commented 1 year ago

Structs like FILE, which are used in external libc functions like fwrite, should have their fields marked FIXED so we don't try to rewrite them. Even changing pointers to &/&mut should be forbidden, even though it doesn't change the layout, because the correctness of that change depends on details of the behavior of the libc functions that use the type.