This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/20111] struct sockaddr_storage cannot be aggregate-copied
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 18 May 2016 07:49:47 +0000
- Subject: [Bug libc/20111] struct sockaddr_storage cannot be aggregate-copied
- Auto-submitted: auto-generated
- References: <bug-20111-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20111
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fweimer at redhat dot com
--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
POSIX does not require that objects of type struct sockaddr_storage can be
copied as aggregates (preserving the contents as a bit-wise copy).
Without compiler support, I do not see how to fix this in a completely reliable
way because the dynamic type of the members will always be wrong (and this will
be quite visible to the compiler in many cases, as in the referenced GCC PR).
If it's sufficient to stick in additional padding fields, then we can make this
change. But I'm not aware that this is a documented GCC extension.
It would be nice to have a GCC attribute to mark struct sockaddr_storage as
unsafe for aggregate copy, so that GCC can warn about this.
--
You are receiving this mail because:
You are on the CC list for the bug.