Skip to content

Use of bitfields in the public ABI #6800

@kornelski

Description

@kornelski

git_fetch_options store flags as a bitfield.

This is a challenge for the Rust wrapper for this library (and possibly other non-C languages), because Rust's FFI doesn't understand C bitfields. Layout of common C types is generally well-known and easy to match, but bitfields are a less common feature, and I don't know how much their layout may vary across compilers, architectures, and endianness.

Could you provide getter and setter functions for manipulating these fields? Or perhaps you could guarantee that the library's ABI will always use the least significant bits of the unsigned int field?

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