Project

General

Profile

Actions

Bug #11983

closed

libsocket: alias between functions of incompatible types

Added by Toomas Soome almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Build errors with gcc 8:

    In file included from ../socket/weaks.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/socket.h:541:12: error: 'bind' alias between functions of incompatible types 'int(int,  const struct sockaddr *, socklen_t)' {aka 'int(int,  const struct sockaddr *, unsigned int)'} and 'int(int,  struct sockaddr *, int)' [-Werror=attribute-alias]
     extern int bind(int, const struct sockaddr *, socklen_t);
                ^~~~
    ../socket/weaks.c:82:1: note: aliased declaration here
     _bind(int sock, struct sockaddr *addr, int addrlen)
     ^~~~~
    In file included from ../socket/weaks.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/socket.h:556:12: error: 'setsockopt' alias between functions of incompatible types 'int(int,  int,  int,  const void *, socklen_t)' {aka 'int(int,  int,  int,  const void *, unsigned int)'} and 'int(int,  int,  int,  char *, int)' [-Werror=attribute-alias]
     extern int setsockopt(int, int, int, const void *, socklen_t);
                ^~~~~~~~~~
    ../socket/weaks.c:214:1: note: aliased declaration here
     _setsockopt(int sock, int level, int optname, char *optval, int optlen)
     ^~~~~~~~~~~
    In file included from ../socket/weaks.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/socket.h:554:16: error: 'sendto' alias between functions of incompatible types 'ssize_t(int,  const void *, size_t,  int,  const struct sockaddr *, socklen_t)' {aka 'int(int,  const void *, unsigned int,  int,  const struct sockaddr *, unsigned int)'} and 'int(int,  char *, int,  int,  struct sockaddr *, int *)' [-Werror=attribute-alias]
     extern ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *,
                    ^~~~~~
    ../socket/weaks.c:150:1: note: aliased declaration here
     _sendto(int sock, char *buf, int len, int flags,
     ^~~~~~~
    In file included from ../socket/weaks.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/socket.h:552:16: error: 'send' alias between functions of incompatible types 'ssize_t(int,  const void *, size_t,  int)' {aka 'int(int,  const void *, unsigned int,  int)'} and 'int(int,  char *, int,  int)' [-Werror=attribute-alias]
     extern ssize_t send(int, const void *, size_t, int);
                    ^~~~
    ../socket/weaks.c:138:1: note: aliased declaration here
     _send(int sock, char *buf, int len, int flags)
     ^~~~~
    In file included from ../socket/weaks.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/socket.h:549:16: error: 'recvfrom' alias between functions of incompatible types 'ssize_t(int,  void *, size_t,  int,  struct sockaddr *, void *)' {aka 'int(int,  void *, unsigned int,  int,  struct sockaddr *, void *)'} and 'int(int,  char *, int,  int,  struct sockaddr *, int *)' [-Werror=attribute-alias]
     extern ssize_t recvfrom(int, void *_RESTRICT_KYWD, size_t, int,
                    ^~~~~~~~
    ../socket/weaks.c:124:1: note: aliased declaration here
     _recvfrom(int sock, char *buf, int len, int flags,
     ^~~~~~~~~
    In file included from ../socket/weaks.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/socket.h:548:16: error: 'recv' alias between functions of incompatible types 'ssize_t(int,  void *, size_t,  int)' {aka 'int(int,  void *, unsigned int,  int)'} and 'int(int,  char *, int,  int)' [-Werror=attribute-alias]
     extern ssize_t recv(int, void *, size_t, int);
                    ^~~~
    ../socket/weaks.c:118:1: note: aliased declaration here
     _recv(int sock, char *buf, int len, int flags)
     ^~~~~
    In file included from ../socket/weaks.c:30:
    /code/illumos-gate/proto/root_i386/usr/include/sys/socket.h:542:12: error: 'connect' alias between functions of incompatible types 'int(int,  const struct sockaddr *, socklen_t)' {aka 'int(int,  const struct sockaddr *, unsigned int)'} and 'int(int,  struct sockaddr *, int)' [-Werror=attribute-alias]
     extern int connect(int, const struct sockaddr *, socklen_t);
                ^~~~~~~
    ../socket/weaks.c:106:1: note: aliased declaration here
     _connect(int sock, struct sockaddr *addr, int addrlen)
     ^~~~~~~~
    cc1: all warnings being treated as errors

Testing done: build/install/boot

Actions #1

Updated by Toomas Soome almost 4 years ago

  • Description updated (diff)
Actions #2

Updated by Electric Monk almost 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 1593262046299386a3cb4f951daa90d15acdfe6c

commit  1593262046299386a3cb4f951daa90d15acdfe6c
Author: Toomas Soome <tsoome@me.com>
Date:   2019-12-16T16:16:56.000Z

    11983 libsocket: alias between functions of incompatible types
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF