Skip to content

if size_t_is_usize is set to true, and bindgen handles a size_t, and size_t ≠ uintptr_t, bindgen should abort #1903

Open
@dkg

Description

@dkg

Many projects (including nettle-sys, linux-kernel-module-rust, nodejs-sys, bcc-sys) are moving to revert to the pre-0.53 behavior that maps size_t and usize. These projects (and many others if #1902 is merged) will fail subtly if they use bindgen over a C API that includes size_t on a weird niche platform where size_tuintptr_t. if bindgen detects that this situation is happening, it should produce an error.

the three conditions that should produce an error (all conditions must be present) are:

  • size_t_is_usize is set to true
  • The source C API includes a size_t
  • The platform's size_t is not the same underlying type as uintptr_t

(see also #1901 and #1671 for background)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions