Skip to content

Verify how to represent arrays in function signatures #5536

Description

@tgross35

E.g. socketpair is:

int socketpair(int domain, int type, int protocol, int sv[2]);

But we have

pub fn socketpair(domain: c_int, type_: c_int, protocol: c_int, socket_vector: *mut c_int) -> c_int;

*mut [c_int; 2] is ABI-compatible and more user-friendly, so we should consider using it and possibly updating ctest to require this kind of thing.

We may not be able to do this in general because technically in C, you can pass more than 2 items. But for most cases this shouldn't be a problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ctestIssues relating to the ctest crate

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions