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 libc/20111] struct sockaddr_storage cannot be aggregate-copied


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.

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