This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug network/19622] Support aliasing with struct sockaddr


https://sourceware.org/bugzilla/show_bug.cgi?id=19622

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
This does not work as expected because it breaks forward declarations:

struct sockaddr;
struct sockaddr *f();

struct __attribute__((may_alias)) sockaddr {};
struct sockaddr *f()
{
  return nullptr;
}

results in:

t.cc: In function âsockaddr* f()â:
t.cc:5:18: error: ambiguating new declaration of âsockaddr* f()â
 struct sockaddr *f()
                  ^

t.cc:2:18: note: old declaration âsockaddr* f()â
 struct sockaddr *f();
                  ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]