Skip to content

Compilation issue on Alphine version 3.2+ #55

@monehsieh

Description

@monehsieh

I encountered a compilation error on Alpine Linux version 3.2+ at line 546:

546:  struct msghdr msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 };

The failure is due to the changes in the struct msghdr layout. Changing the code to the following resolves the issue:

  struct msghdr msg = {
  	.msg_name = &sa,
  	.msg_namelen = sizeof(sa),
  	.msg_iov = &iov,
  	.msg_iovlen = 1,
  	.msg_control = NULL,
  	.msg_controllen = 0,
  	.msg_flags = 0
  };

Also there is a warning at line 305 related to calloc's argument order.

305:  struct endpoint *ep = (struct endpoint *) calloc(sizeof(*ep), 1);

Swapping the argument order removes the warning:

  struct endpoint *ep = (struct endpoint *) calloc(1, sizeof(*ep));

thanks

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