Re: struct sockaddr_storage

2023-01-24 Thread Rich Felker
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 concern I've always had ab

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Eli Zaretskii via Gcc
> Date: Mon, 23 Jan 2023 15:00:56 -0800 > Cc: gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > From: Ian Lance Taylor via Gcc > > > +#ifdef HAVE_WINDOWS_H > > + > > +static char * > > +windows_get_executable_path (char *buf, backtrace_error_callback > > error_callback, > > +

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Ian Lance Taylor via Gcc
On Tue, Jan 24, 2023 at 5:11 AM Eli Zaretskii via Gcc-patches wrote: > > > Date: Mon, 23 Jan 2023 15:00:56 -0800 > > Cc: gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > > From: Ian Lance Taylor via Gcc > > > > > +#ifdef HAVE_WINDOWS_H > > > + > > > +static char * > > > +windows_get_executable_path (ch

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: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Eli Zaretskii via Gcc
> From: Ian Lance Taylor > Date: Tue, 24 Jan 2023 06:35:21 -0800 > Cc: g...@hazardy.de, gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > > > > On Windows it seems that MAX_PATH is not > > > a true limit, as an extended length path may be up to 32767 bytes. > > > > The limit of 32767 characters (not byt

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Ian Lance Taylor via Gcc
On Tue, Jan 24, 2023 at 8:53 AM Eli Zaretskii via Gcc-patches wrote: > > > From: Ian Lance Taylor > > Date: Tue, 24 Jan 2023 06:35:21 -0800 > > Cc: g...@hazardy.de, gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > > > > > > On Windows it seems that MAX_PATH is not > > > > a true limit, as an extended l

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: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Eli Zaretskii via Gcc
> From: Ian Lance Taylor > Date: Tue, 24 Jan 2023 09:58:10 -0800 > Cc: g...@hazardy.de, gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > > I'd rather that the patch look like the appended. Can someone with a > Windows system test to see what that builds and passes the tests? ENOPATCH

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Ian Lance Taylor via Gcc
On Tue, Jan 24, 2023 at 10:12 AM Eli Zaretskii via Gcc-patches wrote: > > > From: Ian Lance Taylor > > Date: Tue, 24 Jan 2023 09:58:10 -0800 > > Cc: g...@hazardy.de, gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org > > > > I'd rather that the patch look like the appended. Can someone with a > > Windows

Re: [PATCH 2/4] libbacktrace: detect executable path on windows

2023-01-24 Thread Björn Schäpers
Am 24.01.2023 um 17:52 schrieb Eli Zaretskii: From: Ian Lance Taylor Date: Tue, 24 Jan 2023 06:35:21 -0800 Cc: g...@hazardy.de, gcc-patc...@gcc.gnu.org, gcc@gcc.gnu.org On Windows it seems that MAX_PATH is not a true limit, as an extended length path may be up to 32767 bytes. The limit of 32