This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] bits/socket.h: Define struct sockaddr with may_alias attribute [BZ #19622]
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 15 Feb 2016 17:49:00 +0100
- Subject: Re: [PATCH] bits/socket.h: Define struct sockaddr with may_alias attribute [BZ #19622]
- Authentication-results: sourceware.org; auth=none
- References: <56BDDAE2 dot 70308 at redhat dot com>
On 02/12/2016 02:15 PM, Florian Weimer wrote:
> It is quite common to use struct sockaddr * as an opaque, void *-like
> type for socket addresses. The POSIX API encourages to some degree.
> Marek Polacek suggested to add the may_alias attribute to the definition
> of struct sockaddr.
> Support for that was introduced in GCC 4.0, so I added a conditional to
It turns out that the current may_alias behavior with C++ is not what we
need. In some places, forward declarations without the attribute are
treated as a different type as the full definition with the attribute.