[PATCH] bits/socket.h: Define struct sockaddr with may_alias attribute [BZ #19622]
Carlos O'Donell
carlos@redhat.com
Fri Feb 12 21:58:00 GMT 2016
On 02/12/2016 11:51 AM, Florian Weimer wrote:
> 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
>> cdefs.h.
>
> I've been told off-list to move the attribute right after the struct,
> and this is the version I will commit if approved.
>
> This patch is a result of the Fedora mass rebuild with GCC 6, where we
> now see a lot of warnings related to this (potential) aliasing violation.
Looks good to me.
c.
More information about the Libc-alpha
mailing list