Re: [PATCH 1/5] rust: fix size_t in bindgen prototypes of C builtins
From: Trevor Gross
Date: Sun Sep 29 2024 - 17:01:11 EST
On Fri, Sep 13, 2024 at 5:32 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
> -bindgen_c_flags_final = $(bindgen_c_flags_lto) -D__BINDGEN__
> +# `-fno-builtin` is passed to avoid bindgen from using clang builtin prototypes
> +# for functions like `memcpy` -- if this flag is not passed, bindgen-generated
> +# prototypes use `c_ulong` or `c_uint` depending on architecture instead of
> +# generating `usize`.
> +bindgen_c_flags_final = $(bindgen_c_flags_lto) -fno-builtin -D__BINDGEN__
I wonder how reliable this behavior is. Maybe bindgen could do a
better job controlling this, is there an open issue?
- Trevor