Skip to content
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

lint mode for int/uint in FFI does not warn about *uint, but should #3395

Closed
nikomatsakis opened this issue Sep 5, 2012 · 4 comments
Closed
Labels
A-FFI Area: Foreign function interface (FFI) A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@nikomatsakis
Copy link
Contributor

Right now if you have an FFI function like:

fn foo(c: *uint, l: uint);

you only get a warning about the variable l, but c is (probably) equally broken. This actually but is in the LLVM bindings, where we translated unsigned * to *uint.

@pcwalton
Copy link
Contributor

pcwalton commented Sep 6, 2012

Additionally, this should actually be checking the types, not operating on the AST level.

@bstrie
Copy link
Contributor

bstrie commented May 6, 2013

This still only warns for the second parameter. A more complete test case:

fn main() {}

extern {
    fn foo(c: *uint, l: uint);
}

@metajack
Copy link
Contributor

Still happens. Nominating production ready since FFI is a huge use case.

@graydon
Copy link
Contributor

graydon commented Jul 11, 2013

accepted for production-ready milestone

@bors bors closed this as completed in d582eeb Jul 13, 2013
RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 23, 2024
RenjiSann pushed a commit to RenjiSann/rust that referenced this issue Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants