Re: realloc: Improve documentation

2024-10-19 Thread Bruno Haible via Gnulib discussion list
Alejandro Colomar wrote: > > +(on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, Solaris, Cygwin). > > Are you sure OpenBSD is on this list? Yes. 1. I checked it on OpenBSD 7.6, with the program that I attached. 2. It is consistent with the experiment that I had done in 2011: https://sourceware.org/

Re: realloc: Improve documentation

2024-10-19 Thread Alejandro Colomar
On Sat, Oct 19, 2024 at 02:23:44PM GMT, Paul Eggert wrote: > Thanks. Some further improvements: > > * Document whether realloc can fail when not growing a region. > > * Mention what happens to errno. > > * Mention how the ISO C standard has evolved here. > > * Give more details as to which glib

Re: realloc: Improve documentation

2024-10-19 Thread Bruno Haible via Gnulib discussion list
Paul Eggert wrote: > Thanks. Some further improvements: > > * Document whether realloc can fail when not growing a region. > > * Mention what happens to errno. > > * Mention how the ISO C standard has evolved here. > > * Give more details as to which glibc versions do what. > > * In the "pract

Re: realloc: Improve documentation

2024-10-19 Thread Bruno Haible via Gnulib discussion list
Alejandro Colomar wrote: > > >(C) usually succeeds and returns a unique zero-size object. > > >And there is also > > >(D) usually succeeds and returns a pointer to freshly-allocated > > > memory > > >of 1 byte. > > I'm not entirely sure what you mean by C and D. I

Re: realloc: Improve documentation

2024-10-19 Thread Paul Eggert
Thanks. Some further improvements: * Document whether realloc can fail when not growing a region. * Mention what happens to errno. * Mention how the ISO C standard has evolved here. * Give more details as to which glibc versions do what. * In the "practical" section, don't bother mentioning p

Re: realloc: Improve documentation

2024-10-19 Thread Alejandro Colomar
Hi Bruno, On Sat, Oct 19, 2024 at 02:23:50PM GMT, Bruno Haible wrote: > I wrote: > >According to our doc, there are three possible behaviours of the realloc > >function: > >With a non-NULL pointer argument p, C17 says that it is > >implementation-defined whether realloc (p,