Skip to content

Feature Request: Make layout tests adaptive to word length of target arch #2033

Open
@wucke13

Description

@wucke13

Currently, if I run bindgen on a 64 bit machine, the generated layout tests will fail on a 32 Bit machine. The reason is, that the layout tests test the exact layout of the machine on which the bindings where generated. I have a use case where it is quite a burden to ship the c header files with the rust crate. Thus I prefer generating the bindings once, and then shipping the generated bindings. However, if I do so, some layout tests fails, as some structures have different representation depending on the word length of the current system. I think it would be a good enhancement to make the layout tests check that the layout of the rust types matches those of the equivalent C types on the target platform (versus the current behavior, where they try to match the platform where bindgen was invoked).

To my surprise I did not find this request in the issues (maybe I overlooked something obvious?) thus I put it here. Any opinions appreciated 😄 !

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