Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

2022-11-28 Thread Alex Colomar via Gcc
Hi Joseph, On 11/14/22 19:13, Joseph Myers wrote: On Sun, 13 Nov 2022, Alejandro Colomar via Gcc wrote: SYNOPSIS: unary-operator: . identifier That's not what you mean. See the standard syntax. Yup; typo there. unary-expression: [other alternatives] unary-operator cast-expressi

Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

2022-11-28 Thread Alex Colomar via Gcc
Hi Joseph, On 11/14/22 19:26, Joseph Myers wrote: On Mon, 14 Nov 2022, Alejandro Colomar via Gcc wrote: To quote the convenor in WG14 reflector message 18575 (17 Nov 2020) when I asked about its status, "The author asked me not to put those on the agenda. He will supply updated versions later

Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

2022-11-28 Thread Alex Colomar via Gcc
Hi Martin, On 11/13/22 15:58, Martin Uecker wrote: Am Sonntag, den 13.11.2022, 15:02 +0100 schrieb Alejandro Colomar: On 11/13/22 14:33, Alejandro Colomar wrote: Hi Martin, On 11/13/22 14:19, Alejandro Colomar wrote: But there are not only syntactical problems, because also the type of the

Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

2022-11-29 Thread Alex Colomar via Gcc
Hi Martin, Joseph, On 11/29/22 18:00, Martin Uecker wrote: Am Dienstag, dem 29.11.2022 um 16:53 + schrieb Jonathan Wakely: On Tue, 29 Nov 2022 at 16:49, Joseph Myers wrote: On Tue, 29 Nov 2022, Michael Matz via Gcc wrote: like.  But I'm generally doubtful of this whole feature within C

Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

2022-11-29 Thread Alex Colomar via Gcc
Hi Martin and Michael, On 11/29/22 17:58, Uecker, Martin wrote: Hi, Am Dienstag, dem 29.11.2022 um 15:44 + schrieb Michael Matz: Hey, On Tue, 29 Nov 2022, Uecker, Martin wrote: It does not require any changes on how arrays are represented. As part of VM-types the size becomes part of

Re: [PATCH] Various pages: SYNOPSIS: Use VLA syntax in function parameters

2022-11-29 Thread Alex Colomar via Gcc
On 11/29/22 18:19, Alex Colomar wrote: Hi Martin, Joseph, On 11/29/22 18:00, Martin Uecker wrote: Am Dienstag, dem 29.11.2022 um 16:53 + schrieb Jonathan Wakely: On Tue, 29 Nov 2022 at 16:49, Joseph Myers wrote: On Tue, 29 Nov 2022, Michael Matz via Gcc wrote: like.  But I'm generally

Re: struct sockaddr_storage

2023-01-24 Thread Alex Colomar via Gcc
Hi Richard, On 1/23/23 17:28, Richard Biener wrote: The common initial sequence of structures is only allowed if the structures form part of a union (which is why to avoid UB you need a union; and still, you need to make sure you don't invoke UB in a different way).

Re: struct sockaddr_storage

2023-01-24 Thread Alex Colomar via Gcc
Hi Jakub, On 1/23/23 17:37, Jakub Jelinek wrote: Please see transparent_union documentation in GCC documentation. E.g. https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Type-Attributes.html#index-transparent_005funion-type-attribute transparent_union doesn't change anything regarding type pu

Re: struct sockaddr_storage

2023-01-24 Thread Alex Colomar via Gcc
Hi Rick, On 1/24/23 12:16, Rich Felker wrote: On Fri, Jan 20, 2023 at 12:06:50PM +0200, Stefan Puiu via Libc-alpha wrote: Hi Alex, On Thu, Jan 19, 2023 at 4:14 PM Alejandro Colomar wrote: Hi! I just received a report about struct sockaddr_storage in the man pages. It reminded me of some c

Re: struct sockaddr_storage

2023-01-24 Thread Alex Colomar via Gcc
Hi, After reading more about transparent_unit, here's my idea of a fix for the API. old_api() is an example for the libc functions that accept a `struct sockaddr *`, and user_code() is an example for user code functions that handle sockaddr structures. The interface would be the same as it

Re: Missed warning (-Wuse-after-free)

2023-02-23 Thread Alex Colomar via Gcc
Hi Martin, On 2/17/23 14:48, Martin Uecker wrote: This new wording doesn't even allow one to use memcmp(3); just reading the pointer value, however you do it, is UB. memcmp would not use the pointer value but work on the representation bytes and is still allowed. Hmm, interesting. It's rath

Re: Missed warning (-Wuse-after-free)

2023-02-23 Thread Alex Colomar via Gcc
Hi Martin, On 2/23/23 20:57, Martin Uecker wrote: Am Donnerstag, dem 23.02.2023 um 20:23 +0100 schrieb Alex Colomar: Hi Martin, On 2/17/23 14:48, Martin Uecker wrote: This new wording doesn't even allow one to use memcmp(3); just reading the pointer value, however you do it, is UB. memcmp w

Re: Missed warning (-Wuse-after-free)

2023-02-23 Thread Alex Colomar via Gcc
Hi Serge, Martin, On 2/24/23 02:21, Serge E. Hallyn wrote: Does all this imply that the following is well defined behavior (and shall print what one would expect)? free(p); (void) &p; // take the address // or maybe we should (void) memcmp(&p, &p, sizeof(p)); ? printf("%p\n", p);