Skip to content

--size_t-is-usize not working if the function is named malloc #1770

@Dirbaio

Description

@Dirbaio

Input C/C++ Header

#include <stddef.h>
void* malloc(size_t size);

which reduces to this:

typedef long unsigned int size_t;
void* malloc(size_t size);

Bindgen Invocation

bindgen --size_t-is-usize test.h -o test.rs  --dump-preprocessed-input

Actual Results

/* automatically generated by rust-bindgen */

extern "C" {
    pub fn malloc(size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void;
}

Expected Results

I'd expect that if --size_t-is-usize, then the function would take an usize instead of a raw::c_ulong.
The --size_t-is-usize seems to be ignored in this case?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions