-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
improper_ctypes lint doesn't detect cross-crate un-ffi-safe structs #20098
Comments
I think this is fixable by just turning the |
huonw
added
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-FFI
Area: Foreign function interface (FFI)
labels
Dec 21, 2014
tomjakubowski
changed the title
improper_ctypes lint doesn't detect cross-crate un-ffi-safe types
improper_ctypes lint doesn't detect cross-crate un-ffi-safe structs
Dec 24, 2014
tomjakubowski
added a commit
to tomjakubowski/rust
that referenced
this issue
Dec 29, 2014
It now checks extern fns in addition to foreign fns and checks `DefStruct` defs as well. There is room for improvement: for example, I believe that pointers should be safe in extern fn signatures regardless of the pointee's representation. The `FIXME` on `rust_begin_unwind_fmt` is because I don't think it should be, or needs to be, C ABI (cc @eddyb) and it takes a problematic `fmt::Arguments` structure by value. Fix rust-lang#20098, fix rust-lang#19834
This and #19834 are still serious and might be masking bugs in programs exporting a native interface. I'll see if I can revive my PR from a few months ago. |
This seems to be fixed in the current stable: http://is.gd/Ew2jCI |
Yay, thanks @TimNN! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example, it accepts this:
Even though
String
is not FFI safe.The text was updated successfully, but these errors were encountered: