-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
The improper_ctypes lint is very weak #36464
Copy link
Copy link
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
This code compiles without warnings. I think that the improper_ctypes lint should catch both of the extern declarations.
The array case (
foo) is particularly nasty. On brief, insufficiently careful inspection, it looks like it matches:But it actually doesn't match that and instead seems to try to pass the array in packed form in
xmm0on x86_64. This is extra nasty because I think I've caughtrust-bindgengenerating bindings like this.