Skip to content

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

Closed

Description

@nikomatsakis

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.

Activity

  1. pcwalton commented on Sep 6, 2012

    @pcwalton
    Contributor

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

  2. bstrie commented on May 6, 2013

    @bstrie
    Contributor

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

    fn main() {}
    
    extern {
        fn foo(c: *uint, l: uint);
    }
  3. metajack commented on Jul 11, 2013

    @metajack
    Contributor

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

  4. graydon commented on Jul 11, 2013

    @graydon
    Contributor

    accepted for production-ready milestone

  5. added a commit that references this issue on Jul 13, 2013
    d582eeb
  6. added a commit that references this issue on Mar 23, 2024
  7. added a commit that references this issue on Mar 25, 2024
  8. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions