Skip to contentSkip to conversation

sockaddr.3type: POSIX Issue 8 will solve strict-aliasing issues with these types

PATCH In review Alejandro Colomar 2 participants 2 messages Apr 21, 2023 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): sjomqddm5sik7zufnpozmagkbgnjiu55vbozruh4nsehg7hqqi@hl3jl5yde5pl

#1 lore raw

PATCH v3 1/1 sockaddr.3type: POSIX Issue 8 will solve strict-aliasing issues with these types

---

Hi Eric,

I took your informal review as a "Reviewed-by". Please confirm. I've also modified the small wording thingy you suggested.

I'll float this patch in the list in case anyone has comments, and will push some time this weekend (depending on many variables).

Cheers,
Alex

 man3type/sockaddr.3type | 8 ++++++++
 1 file changed, 8 insertions(+)
man3type/sockaddr.3type +8 -0
index 2fdf56c59..cf8d601f5 100644
@@ -117,6 +117,14 @@ .SH HISTORY
 was invented by POSIX.
 See also
 .BR accept (2).
+.PP
+These structures were invented before modern ISO C strict-aliasing rules.
+If aliasing rules are applied strictly,
+these structures would be extremely difficult to use
+without invoking Undefined Behavior.
+POSIX Issue 8 will fix this by requiring that implementations
+make sure that these structures
+can be safely used as they were designed.
 .SH NOTES
 .I socklen_t
 is also defined in
Signature · 1 line
2.40.0
Reviewed-by on v3 1/1
#2 lore raw
Quoted 17 lines · Alejandro Colomar
Quoted 6 lines

---

Hi Eric,

I took your informal review as a "Reviewed-by". Please confirm. I've also modified the small wording thingy you suggested.

For the avoidance of doubt ;)

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org