AS UN TO

2023-02-06 Thread Manuel Aarón Rojas Salinas via Gcc

Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union

2023-02-06 Thread Rich Felker
On Mon, Feb 06, 2023 at 02:02:23PM +0800, Xi Ruoyao wrote: > On Sun, 2023-02-05 at 16:31 +0100, Alejandro Colomar via Libc-alpha wrote: > > > The only correct way to use  different  types  in  an  API  is > > through  a  union. > > I don't think this statement is true (in general). Technically w

Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union

2023-02-06 Thread Alejandro Colomar via Gcc
Hi Xi, On 2/6/23 07:02, Xi Ruoyao wrote: On Sun, 2023-02-05 at 16:31 +0100, Alejandro Colomar via Libc-alpha wrote: The only correct way to use  different  types  in  an  API  is through  a  union. I don't think this statement is true (in general). Technically we can write something like th

Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union

2023-02-06 Thread Rich Felker
On Mon, Feb 06, 2023 at 12:55:12PM +0100, Alejandro Colomar wrote: > Hi Xi, > > On 2/6/23 07:02, Xi Ruoyao wrote: > >On Sun, 2023-02-05 at 16:31 +0100, Alejandro Colomar via Libc-alpha wrote: > > > >>The only correct way to use  different  types  in  an  API  is > >>through  a  union. > > > >I don

Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union

2023-02-06 Thread Alejandro Colomar via Gcc
Hi Rich, On 2/6/23 14:38, Rich Felker wrote: There is absolutely not any need to declare the union for application code calling the socket APIs. You declare whatever type you will be using. For binding or connecting a unix socket, sockaddr_un. For IPv6, sockaddr_in6. Etc. Then you cast the point

[no subject]

2023-02-06 Thread siraj mohammad via Gcc
Aw6394373

Aw6394373

2023-02-06 Thread siraj mohammad via Gcc
Aw6394373

Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union

2023-02-06 Thread Rich Felker
On Mon, Feb 06, 2023 at 03:11:10PM +0100, Alejandro Colomar wrote: > Hi Rich, > > On 2/6/23 14:38, Rich Felker wrote: > >There is absolutely not any need to declare the union for application > >code calling the socket APIs. You declare whatever type you will be > >using. For binding or connecting

Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union

2023-02-06 Thread Eric Blake via Gcc
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 > and > .IR . > +.SH BUGS > +.I sockaddr_storage > +was designed back when strict aliasin

Re: [PATCH] sockaddr.3type: BUGS: Document that libc should be fixed using a union

2023-02-06 Thread Alejandro Colomar via Gcc
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 and .IR . +.SH BUGS +.I sockaddr_storage