about summary refs log tree commit diff
path: root/socket/sys
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-05-18 09:33:19 +0200
committerFlorian Weimer <fweimer@redhat.com>2024-05-27 17:25:13 +0200
commit26e7005728f0eea2972474e6be2905c467661237 (patch)
treecc9b1d51cd6805f7f7caaf6310152cac6c43971b /socket/sys
parent9f2b100d6705b9bbb25206b53e80d7759644e06e (diff)
downloadglibc-26e7005728f0eea2972474e6be2905c467661237.tar.gz
glibc-26e7005728f0eea2972474e6be2905c467661237.tar.xz
glibc-26e7005728f0eea2972474e6be2905c467661237.zip
socket: Use may_alias on sockaddr structs (bug 19622)
This supports common coding patterns.  The GCC C front end before
version 7 rejects the may_alias attribute on a struct definition
if it was not present in a previous forward declaration, so this
attribute can only be conditionally applied.

This implements the spirit of the change in Austin Group issue 1641.

Suggested-by: Marek Polacek <polacek@redhat.com>
Suggested-by: Jakub Jelinek <jakub@redhat.com>
Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 8d7b6b4cb27d4dec1dd5f7960298c1699275f962)
Diffstat (limited to 'socket/sys')
-rw-r--r--socket/sys/un.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/socket/sys/un.h b/socket/sys/un.h
index bf03b7d6ce..ff9cbd6efa 100644
--- a/socket/sys/un.h
+++ b/socket/sys/un.h
@@ -26,7 +26,7 @@
 __BEGIN_DECLS
 
 /* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket.  */
-struct sockaddr_un
+struct __attribute_struct_may_alias__ sockaddr_un
   {
     __SOCKADDR_COMMON (sun_);
     char sun_path[108];		/* Path name.  */