From: Alejandro Colomar <alx.manpages@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: linux-man@vger.kernel.org, "Alejandro Colomar" <alx@kernel.org>,
GCC <gcc@gcc.gnu.org>, glibc <libc-alpha@sourceware.org>,
"Bastien Roucariès" <rouca@debian.org>,
"Stefan Puiu" <stefan.puiu@gmail.com>,
"Igor Sysoev" <igor@sysoev.ru>, "Rich Felker" <dalias@libc.org>,
"Andrew Clayton" <a.clayton@nginx.com>,
"Richard Biener" <richard.guenther@gmail.com>,
"Zack Weinberg" <zack@owlfolio.org>,
"Florian Weimer" <fweimer@redhat.com>,
"Joseph Myers" <joseph@codesourcery.com>,
"Jakub Jelinek" <jakub@redhat.com>
Subject: Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union
Date: Tue, 7 Feb 2023 02:21:41 +0100 [thread overview]
Message-ID: <ee4a4399-e50f-d45e-9ee3-ccc39d554818@gmail.com> (raw)
In-Reply-To: <20230206184530.zn5kq7x6xmcfxhqm@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1932 bytes --]
Hello Eric,
On 2/6/23 19:45, Eric Blake wrote:
> On Sun, Feb 05, 2023 at 04:28:36PM +0100, Alejandro Colomar wrote:
>
> Regardless of the merits of the patch, let's not introduce typos:
>
>> +++ b/man3type/sockaddr.3type
>> @@ -120,6 +120,26 @@ .SH NOTES
>> .I <netinet/in.h>
>> and
>> .IR <sys/un.h> .
>> +.SH BUGS
>> +.I sockaddr_storage
>> +was designed back when strict aliasing wasn't a problem.
>> +Back then,
>> +one would define a variable of that type,
>> +and then access it as any of the other
>> +.IR sockaddr_ *
>> +types,
>> +depending on the value of the first member.
>> +This is Undefined Behavior.
>> +However, there is no way to use these APIs without invoking Unedfined Behavior,
>
> Undefined
>
>> +either in the user program or in libc,
>> +so it is still recommended to use this method.
>> +The only correct way to use different types in an API is through a union.
>> +However,
>> +that union must be implemented in the library,
>> +since the type must be shared between the library and user code,
>> +so libc should be fixed by implementing
>> +.I sockaddr_storage
>> +as a union.
>> .SH SEE ALSO
>> .BR accept (2),
>> .BR bind (2),
>
> Also, while I could raise the issue with the Austin Group on your
> behalf to get the POSIX wording improved, I think it would work better
> if you initiate a bug report rather than having me do it:
>
> https://www.austingroupbugs.net/main_page.php
I gave it a try after a year since my last attempt. The open group website is
one of the worst I've ever seen. I'm sorry, I can't get it to work. Could you
please report a bug on my behalf?
I have an opengroup account, and supposedly am subscribed to the austin-group-l
mailing list. But I'm not able to log it.
Thanks,
Alex
>
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-02-07 1:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-05 15:28 [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union Alejandro Colomar
2023-02-05 15:31 ` Alejandro Colomar
2023-02-06 6:02 ` Xi Ruoyao
2023-02-06 11:20 ` Rich Felker
2023-02-06 11:55 ` Alejandro Colomar
2023-02-06 13:38 ` Rich Felker
2023-02-06 14:11 ` Alejandro Colomar
2023-02-06 17:48 ` Rich Felker
2023-02-05 23:43 ` Rich Felker
2023-02-05 23:59 ` Alejandro Colomar
2023-02-06 0:15 ` Rich Felker
2023-02-06 18:45 ` Eric Blake
2023-02-07 1:21 ` Alejandro Colomar [this message]
2023-03-18 7:54 ` roucaries bastien
2023-03-20 10:49 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee4a4399-e50f-d45e-9ee3-ccc39d554818@gmail.com \
--to=alx.manpages@gmail.com \
--cc=a.clayton@nginx.com \
--cc=alx@kernel.org \
--cc=dalias@libc.org \
--cc=eblake@redhat.com \
--cc=fweimer@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=igor@sysoev.ru \
--cc=jakub@redhat.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-man@vger.kernel.org \
--cc=richard.guenther@gmail.com \
--cc=rouca@debian.org \
--cc=stefan.puiu@gmail.com \
--cc=zack@owlfolio.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.